Re: REs as generators

2002-12-11 Thread Dave Storrs
On Tue, Dec 10, 2002 at 10:37:10PM -0700, Luke Palmer wrote: > Why use regexen when you can just use junctions? > > my $foos = 'foo' ~ any(0..9) ~ any(0..9); At what moment does a junction actually create all of its states? Hmm...perhaps a clearer way to say that is "At what moment does a ju

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Dave Whipp
-ness (I use the latter frequently: but I write a lot of code for testing and debugging -- its my job). So perhaps the C<===> operator could be used for comparison under the default equivalence-class of the operands. I'd find it unintuitive, but I'm could get used to it. Dave.

Re: Everything is an object.

2002-12-11 Thread Dave Whipp
s all the other parts of the language. Sometimes people seem to think that the only alternative is to add built-ins: but this really shouldn't be the case -- not in a language as powerful as Perl6. Dave.

Re: Everything is an object.

2002-12-11 Thread Dave Whipp
ative: just explaining why we keep proposing built-ins instead of using the methods on objects. Dave.

Re: is it required to use type declarations? (was Re: 'hashkey context/Str context')

2002-12-12 Thread Dave Storrs
On Wed, Dec 11, 2002 at 12:13:49PM -0700, Luke Palmer wrote: > [Dks wrote:] > > So...are we intending that types and type safety will be like 'use > > strict' (optional and only on request), or will they be like sigils > > (mandatory, can't be turned off)? Or, perhaps, on by default but able > >

Re: REs as generators

2002-12-12 Thread Dave Storrs
On Thu, Dec 12, 2002 at 10:35:47AM +1100, Damian Conway wrote: > Dave Storrs wrote: > > - the ability for the programmer to set "limiters" (??better name??) > > on the junction, which will specify how the junction should > > collapse--e.g. always collapse to the l

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Dave Storrs
On Wed, Dec 11, 2002 at 02:54:18PM -0800, Dave Whipp wrote: > "Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > > After thinking about it a little more, I'll set myself on the "yes" > > side. And propose either '===' or ':=:'

Re: Comparing Object Identity

2002-12-12 Thread Dave Whipp
... [ time passes ] ... if $an_object.id == $remembered_id { ... } If memory addresses can change over time, then we need a more fundamental concept to act as the ID! Dave.

Re: Comparing Object Identity

2002-12-12 Thread Dave Whipp
header stays constant. > This is to minimize the insanity of pointer chasing in C. The address may be constant for the life of the process: but some objects persist a bit longer. These cases can probably be covered by a C<.guid> method. Is this method a member of C, or only of C? Dave.

Re: Comparing Object Identity

2002-12-12 Thread Dave Whipp
ct. Brent indicated that he could think of no reason for the "header address" to change: but that isn't strong enough. We need a cast- iron guarantee. Otherwise we can't compare identity using .id. Dave.

Re: Exists and hypotheticals (Was: Re: Comparing Object Identity)

2002-12-13 Thread Dave Storrs
On Thu, Dec 12, 2002 at 09:39:18PM -0500, James Mastros wrote: > On 12/12/2002 8:07 PM, Larry Wall wrote: > > Ordinarily you'd test for subs with one of > > > > exists &Main::foo > > &Main::foo.exists > I thought that was now spelt exists %Main::{&foo} -- that the symbol > tables were now

Re: Comparing Object Identity

2002-12-13 Thread Dave Storrs
On Fri, Dec 13, 2002 at 09:56:15AM -0500, John Siracusa wrote: > Using the method/attribute named "id" for "this is the same object" > comparisons is just plain bad Huffman coding. The "this is the same object" > method/attribute should have a name that reflects the relative rarity of its > use.

Re: Comparing Object Identity [x-adr][x-bayes]

2002-12-13 Thread Dave Storrs
On Fri, Dec 13, 2002 at 09:49:44AM -0600, Garrett Goebel wrote: > Other common names for the proposed .id are: > > UUID: Universal Unique Identifier (DCE) > GUID: Globally Unique Identfier (EFI) > > Of the 2, usage of "GUID" seems to be more common IMHO. Both of the above > are identical in imple

Re: Comparing Object Identity

2002-12-16 Thread Dave Storrs
On Fri, Dec 13, 2002 at 09:32:02AM -0800, Michael Lazzaro wrote: > > $obj.ID; > $obj.IDENTITY; FWIW, I favor the latter. --Dks

Re: Everything is an object.

2002-12-16 Thread Dave Storrs
On Mon, Dec 16, 2002 at 06:47:39PM +, Piers Cawley wrote: > Michael Lazzaro <[EMAIL PROTECTED]> writes: > > > Mind you (purely devil's advocate), I'm not entirely sure the R-to-L > > syntax truly _needs_ to be in Perl6. It's true I use it all the time, > > but I can retrain to use L-to-R meth

Re: Comparing Object Identity

2002-12-16 Thread Dave Whipp
t is the lack of symmetry. Is there any reason why an adverb syntax can't work: $a eq : ID $b # yes, I would want to generalize that This infix style might separate the operands visually. So perhaps eq:ID($a, $b) Dave.

Re: Comparing Object Identity

2002-12-16 Thread Dave Whipp
$a eq:w $b # compare, ignore whitespace differences $a eq:ID $b # compare identities I think that the modifier concept is too useful to be limited to the rx// operator. But there is the issue of passing parameters to modifiers. I could live with a restriction that forces me to use the prefix (cf infix) form of the modified operator. Dave.

Re: Everything is an object.

2002-12-16 Thread Dave Storrs
On Mon, Dec 16, 2002 at 08:26:25PM +, Piers Cawley wrote: > Dave Storrs <[EMAIL PROTECTED]> writes: > > On Mon, Dec 16, 2002 at 06:47:39PM +, Piers Cawley wrote: > >> Michael Lazzaro <[EMAIL PROTECTED]> writes: > I haven't been arguing against his syn

Re: Everything is an object.

2002-12-16 Thread Dave Storrs
On Mon, Dec 16, 2002 at 03:44:21PM -0500, Dan Sugalski wrote: > At 11:12 AM -0800 12/16/02, Dave Storrs wrote: > >You find R2L easier to read, I find L2R > >easier. TIMTOWDI. Perl6 should be smart enough to support both. > > Why? > > Yes, technically we can do bo

Re: is it required to use type declarations?

2002-12-18 Thread Dave Storrs
On Wed, Dec 18, 2002 at 09:31:41AM +, Piers Cawley wrote: > Dave Storrs <[EMAIL PROTECTED]> writes: > > It seems like Perl6 is moving farther and farther away from Perl5's > > (almost) typelessness. > > It depends what you mean by typed. Perl has always had

Re: is it required to use type declarations?

2002-12-18 Thread Dave Storrs
Attribution lists are getting a bit complex. This is in response to what Piers wrote on Wed, Dec 18, 2002 at 03:50:44PM +. DKS > > [specifying types] > > Hm. I'm way short on sleep today, so I'm probably missing something, > > but I don't see why Perl can't sort this out without a specific

Re: tree frobbing facilities in Perl6?

2002-12-24 Thread Dave Whipp
estion: can I use C inside a recursive implementation of the iterator?) Dave.

Variable Types Vs Value Types

2003-01-03 Thread Dave Whipp
CHSIZE + $b.sum; and prints 9. We don't need the variable-type magic, of course. We could have just said print @a + @a.sum; and gotten the same result. But the ability to express the behaviour of variables, independently of values, could be useful (and more powerful than a c). Dave.

Re: Variable Types Vs Value Types

2003-01-05 Thread Dave Whipp
s in different contexts. Sure, we can define multiple interfaces; but then we run into issues with namespace conflicts. I'm not sure how useful this stuff would be; nor how bad the potential for confusion is. But it feels like a good conceptual unification. Dave.

Re: Variable Types Vs Value Types

2003-01-07 Thread Dave Whipp
is a primitive "array" type that is promoted to an objectified Array class when needed. This would be analogous to the int/Int distinction for primitive numbers. This would be visible to programmers, but may be acceptable for the same reason as the int/Int types are. Of course, it's up to Dan to clarify his own intent: these are just my opinions. Dave.

Re: Variable Types Vs Value Types

2003-01-07 Thread Dave Whipp
y.new(1,2,3); # calls MyArray.new(Array) print int(@c); # calls MyArray.new() This could easily be extended to Scalars: we could autovivify on first use of an uninitialized variable. The default Scalar class's .new method would create an undef value; but other classes could do something

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-08 Thread Dave Whipp
arentheses: @a = 1, 2, 3; # newbie error @a <~ 1, 2, 3; # would work Something else springs to mind. Consider the C syntax: for 1,2,3 ~> foo -> $a { ... } Is there any way we could unify these two operators without creating ambiguities? If we could, then using straight arrows would be nicer to type than the squiggly ones. Dave.

Re: L2R/R2L syntax

2003-01-17 Thread Dave Whipp
gt; is an L2R pipe into a block: not an anonymous sub composer. Similarly, the C function is a strange thing sends its elements down the pipe, one-by-one -- its not a loop at afterall! (A junction, in contrast, would send its elements down the pipe in random order, or concurrently). Dave. p.s. has Larry finished with those LoTR DVDs yet?

Re: L2R/R2L syntax

2003-01-18 Thread Dave Whipp
v, helping perl5 people. Ah, well. :-/ Not exactly equivalent: C would have a higher precedence than ->: Dave.

C as a "junction" operator

2003-01-18 Thread Dave Whipp
for 1,2,3 -> { print }; would naturally behave correctly. But by defining a special type of sequentially distributed junction, we can do all sorts of clever (and therefore nasty) things. Dave. -- mailto:[EMAIL PROTECTED]; http://dave.whipp.name

Re: C as a "junction" operator

2003-01-20 Thread Dave Whipp
ave them like so: [...] I wasn't thinking of a sacrifice: just an adjustment of perception to integrate with pipelining. Dave.

Re: A proposal on if and else

2003-01-21 Thread Dave Whipp
elsif" -- so this isn't a problem. > > > > I think the point of having C as a sub rather than as a separate > syntax is so the parser doesn't have to do anything special for > special keywords. The specialness could be generalized, so that its no longer a parser hack: #define elsif else if Dave.

Re: Why C needs work (was Re: L2R/R2L syntax)

2003-01-22 Thread Dave Whipp
t the basic C to work. And then we can replace the ~> with ->: for 1,2,3,4 -> sub ($a, $b) { $a+$b } -> sub ($a) { $a**2 } -> { $^foo - 1 } -> print; And this begs the question: what exactly does the C contribute to the semantics of the pipeline? What would C (in void context) do differently? Dave.

Re: Why C needs work (was Re: L2R/R2L syntax)

2003-01-22 Thread Dave Whipp
-> print The "obj ~> method args" form calls the method on the object. C is then a method (called on the entire list) that calls its codeblock for each member The "for list -> sub" would call the sub for each member of the list. Hence an equivalence: for list -> { per-elem code } eq list ~> map { per-elem code } But remember, this is all getting very hypothetical: -> doesn't (currently) mean "L2R pipe into sub" Dave.

Re: More Array Behaviors

2003-01-27 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >... if such capabilities exist, what are their real names? Can > anyone think of any that are absolute must-haves? Are any of the above > must-haves? I think that the only must-have is the a

Re: More Array Behaviors

2003-01-27 Thread Dave Whipp
"Damian Conway" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dave Whipp suggested: > > > The size constraints are probably C properties, as is C. The > > exception behavior probably deserves to remain an C prope

Re: More Array Behaviors

2003-01-27 Thread Dave Whipp
f an object wants to have properties that apply to all references (to a given instance), then that property must be defined as an attribute of the object. An instance, itself, doesn't have postIt style properties. Dave.

Re: Arrays: Default Values

2003-01-28 Thread Dave Whipp
"infinite" array still get an exception thrown when trying to access an infinite [Inf] or [-Inf] index? STRAWMAN ANSWER: Yes, it does. Should follow (3a): the generator can through the exception if desired. Now, what about @a[2.5]: can my generator do interpolation? Dave. -- http://dave.whipp.name

Re: Arrays: Default Values

2003-01-28 Thread Dave Whipp
bject which, if assigned to, will create the required element. Dave. -- http://dave.whipp.name

Re: Arrays: Default Values

2003-01-29 Thread Dave Whipp
there's a cost, but if the programmer asks for something, then they pay for it. But the implementation guys aren't allowed to play bait-and-switch! Dave. -- http://dave.whipp.name

Re: Arrays: Default Values

2003-01-31 Thread Dave Mitchell
On Fri, Jan 31, 2003 at 05:59:46PM +0100, Leopold Toetsch wrote: > A lvalue param is not strictly reading, but here has to happen something > differently - yes: > > IMHO some sort of proxy could be passed here, saying: "if you write to > me, this will be at @a[0]". Or auto-vivify the entry. Thi

Re: Shortcut: ?=

2003-02-03 Thread Dave Mitchell
On Mon, Feb 03, 2003 at 06:25:09AM -0800, Austin Hastings wrote: > The only time this doesn't change type (arguably a bad thing in its own > right) is when you're doing boolean ops. And for those, there exist > boolean operators. Changing type is a very Perlish thing to do. > > How 'bout a shortc

Re: Arrays vs. Lists

2003-02-07 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Along those lines, the closest I've been able to come so far to a > usable two-sentence definition is: > > -- A list is an ordered set of scalar values. quibble: that's an "ordered bag", isn't it?

Re: Arrays vs. Lists

2003-02-11 Thread Dave Whipp
"Mark J. Reed" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On 2003-02-11 at 17:44:08, Mark J. Reed wrote: > > pop @{[@a,@b,@c]} > > > > It creates an anonymous array, then removes the last element, leaving two > > elements in the array - which is i

Re: Arrays vs. Lists

2003-02-11 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What is the utility of the perl5 behavior: > > \($a,$b,$c) > > meaning > > (\$a, \$b, \$c) > > Do people really do that? I must say, given that it looks *so > obviously* like it instead

Re: Arrays, lists, referencing

2003-02-18 Thread Dave Mitchell
in perl 5: $value = (1,2, @ARGV,3,4)[$i] That's a list, and its length is not known at compile time. Dave. -- Nothing ventured, nothing lost.

Re: Object spec

2003-03-06 Thread Dave Whipp
n much the same was as classes: class Assoc1 is association( Type1 $source, Type2 @target is sorted { $^a cmp $^b } is unique ) { ... } #later my @type2_objs = $type1_obj.target; (Or perhaps the Perl5 arrow syntax would be more appropriate here). Dave.

Re: A6: Complex Parameter Types

2003-03-10 Thread Dave Whipp
much of an issue for single scalars/ints/strs. If the coercion is lazy, then its not really any more expensive than coercing individual scalars, as needed. Dave.

A6: macro invocants

2003-03-11 Thread Dave Whipp
$db.select * FROM Foo WHERE Foo.bar LIKE a%b; Could I implement this with the select function being a macro on the Database base class: but invoked via the $db invocant? I am aware that the macro would be a compile-time operation: but it could resolve into a run-time mechanism that uses the invoc

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
macros in it will be expanded. How would an infix macro indicate that it didn't want to handle the "$io.select" example? If it returns its input, unchanged, then that would be an infinite loop. Dave. -- http://dave.whipp.name

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
c methods in a standard sequence. I would consider my "macromethod" in a similar vain. Dave. -- http://dave.whipp.name

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
t looking like Perl6 code. Perhaps I should back off a bit: Perl6 *will* be powerful enough support the "Macros::macromethod" module, so perhaps I'll be able to write it in a year's time, or so. It'll be a good test of the extensability mechanisms. Dave. -- http://dave.whipp.name

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
Brent Dax wrote: Dave Whipp: # But you're right, there are situations where the (base) type # might not # be knowable: and these could result in syntax errors. Except they wouldn't, at least not always. [snip] The only part of that I'm not sure about is infix:LIKE, since such an

Re: a thought on multiple properties

2003-03-13 Thread Dave Whipp
Foo is Bar; typedef Baz is Bar; Foo.isa("Baz") == TRUE; The problem biols down to the fact that inheritance hierarchies are, um, hierarchies -- trees. The lightwieght mechanism provides aliases for nodes within the tree, thus all descendent nodes are also descendents of the ali

Re: A6: Strict signature checking - was: Complex Parameter Types

2003-03-13 Thread Dave Whipp
ld be a simple prefix operator to enable coercion of typed things. Perhaps the "splat" operator could serve here: my Str $a = <>; my Int $b = $a;# Error -- $a is explicitly typed as Str my Int $c = $a.num # OK -- explicit corcion my Int $d = *$a; # OK -- splat permits implicit coercion Dave. -- http://dave.whipp.name

Re: [SUMMARY] A6: Type Inference (was Re: A6: Strict signature checking)

2003-03-14 Thread Dave Whipp
Michael Lazzaro wrote: 3) If an "untyped" var is used for a typed parameter, a simple dataflow analysis is used to determine whether the compiler can guarantee that, at that point, an "untyped" var will _always_ contain values of a known, specific type. If so, the type is inferred (silently or

Re: is static?

2003-03-15 Thread Dave Whipp
Uri Guttman wrote: talking about nested subs brought up another related idea, static (not on the stack) lexicals inside subs. Doesn't C give you this? Dave. -- http://dave.whipp.name

Re: A6: Complex Parameter Types

2003-03-17 Thread Dave Whipp
one value -- there should be no expectation that it should behave like an integer, etc. So my Scalar $a = 1; should be an error -- you'd have to call the STORE method explicitly to store the value into the scalar value. Dave. -- http://dave.whipp.name

Re: == vs. eq

2003-04-01 Thread Dave Whipp
ot;eq:id" is much easier to generalize/extend. Dave. -- http://dave.whipp.name

Re: Short-circuiting user-defined operators

2003-04-01 Thread Dave Whipp
Joe Gottman wrote: Alternatively, there might be a new parameter type that indicates that the parameter is not evaluated immediately: sub infix:!! ($lsh, $rhs is deferred) {...} A nice concept! So nice, in fact, that it would be a shame to limit it to function args. I could see myself writing:

Re: Conditional Cs?

2003-04-02 Thread Dave Whipp
Reading A6, I was wondering if the following would work: sub return_if_true ($value) { if ($value) { leave where=>caller(1), value=>$value } }

Re: Short-circuiting user-defined operators

2003-04-03 Thread Dave Whipp
cros. I tend to agree; but I note that it is possible to implement (1) over the semantics of (2) by simply assigning to a tmp variable. The reverse is not true. So if only one of the two is provided, then it should be (2). Multiple properties can be applied, so "is deferred is cached"

Re: How shall threads work in P6?

2003-04-04 Thread Dave Mitchell
On Tue, Apr 01, 2003 at 08:44:25AM -0500, Dan Sugalski wrote: > There isn't any, particularly. We're doing preemptive threads. It > isn't up for negotiation. This is one of the few things where I truly > don't care what people's opinions on the matter are. Sorry, I haven't been following this to

Re: Cothreads [was Re: Coroutines]

2003-05-27 Thread Dave Whipp
be a synch message that you're expected to reply to. * halt (aka wait for finalize) -- the thread has nothing more to do. * destroy execution context -- not needed if GCed. Dave.

Re: Cothreads

2003-05-27 Thread Dave Whipp
nts), the code for C and C would be broadly independent of the execution mode. Though there could clearly be an expectation: for thread { my $a=0; sleep 1 and yield ++$a while $a<10 } -> $t { print "time=$t\n" } then s/thread/coro/; Dave.

Re: Cothreads

2003-05-27 Thread Dave Whipp
be a coroutine as an idiom whereby user-code becomes a thread-scheduler). The problem I see with the general approach is that it might not make the common cases sufficiently trivial. Dave.

Re: Cothreads [was Re: Coroutines]

2003-05-27 Thread Dave Whipp
nes themselves. My summary is that yes, coroutines and threads are very different things. But most of the language-infrastructure needed to support one, is also needed for the other. Dave.

Re: Cothreads

2003-05-28 Thread Dave Mitchell
On Tue, May 27, 2003 at 02:05:57PM -0700, Michael Lazzaro wrote: > If we could think about "threads" not in terms of forkyness, but simply > in terms of coroutines that can be called in parallel, it should be > possible to create an implementation of "threading" that had to do a > whole heck-of-

Re: Cothreads

2003-05-29 Thread Dave Mitchell
On Wed, May 28, 2003 at 07:58:37AM -0700, Austin Hastings wrote: > On a single-CPU box, the OS level threads could easily be used to > support blocking operations feeding back to async I/O, while all "real > work" (execution of opcodes) was done in a single thread. Parrot could > elect to implement

Re: Cothreads

2003-05-29 Thread Dave Whipp
terms of liberated coroutines, you could instead try to understand coroutines in terms constrained threads ;-). If a fork-like behavior is useful for threads, it may also be useful for coroutines. But fork is a bit like goto -- its an unstructured primitive. Dave.

Re: Cothreads [Philosophy]

2003-05-29 Thread Dave Whipp
thread foo is input($a,$b,$c) is output($x,$y,$z) { when $a { $x.yield $a+1 } when $b & $c { $y.yield $b+$c; $z.yield $b-$c } } Dave.

Re: Cothreads [Philosophy]

2003-05-29 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> wrote > --- Dave Whipp <[EMAIL PROTECTED]> wrote: > > "Austin Hastings" <[EMAIL PROTECTED]> wrote: > > > 1. C always acts the same way -- stores args in > > CurThread.result > > > and gi

Re: Cothreads [Philosophy]

2003-05-29 Thread Dave Whipp
ts, e.g. "why should > the caller care if what they're doing invokes parallelization, so long > as it does the right thing?") Indeed: why should be callee care, either? Dave.

Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
change. There are some obvious hacks that could work here: but is there a really nice solution. Ideally, we won't need the low level details such as C<$tid> Dave.

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
ult } default => { status_monitor $tid.progress } } Perhaps a different keyword would be better: C as the looping counterpart to C -- then extend C to accept a code block. Dave.

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
p @_ }; loop { timeout(60); return $result; CATCH Timeout { print "...$(time)\n" } } At last, no C! (Reminder: the suggested semantics of the threaded variable were that a FETCH to it blocks until the result of the thread is available). Dave.

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
I think this hides the threads pretty effectively. Is a parrot-level timer to much to ask for? How about resumable exceptions? But perhaps I'm still being too clever, when a simpler solution exists: sub slow_fn { my $tick = Timer.new(60, { print "..." }); return slow_fn_imp @_; } Now if I could just get the compiler to not complain about that unused variable... Dave.

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
not sure that the GC guarentees that. I might need sub slow_fn { my $timer is last { .stop } = Timer.new(60, { print "." }); return slow_fn_imp @_; } but that's starting to get cluttered again. Dave.

Timers (was Threads and Progress Monitors)

2003-05-31 Thread Dave Whipp
uld this work correctly maybe? > > sub slow_fn { > my $timer is last { .stop } = new Timer secs => $_=1, >reset => {$_++}, > code => {print "."}; > return slow_fn_imp @_; > } > > Isn't that $_ proprietary to slow_fn such that it *would* work? I had to stare at it for a few moments, but yes: I think it should work (if we define a .reset attribute that accepts a codeblock). Dave.

Re: Timers (was Threads and Progress Monitors)

2003-05-31 Thread Dave Whipp
s no possible way the coerce it back into the coroutine (i.e. to "un-launch" it). Now here's another semantics question: would we want the following to be valid? sub slow { timeout(60) { return undef but "Error: timed out" }; return @slow_imp; } How about: sub slow { timeout(60) { throw TimeoutException.new("Error: slow_fn timed out") }; return @slow_imp; } Dave.

Re: Timers (was Threads and Progress Monitors)

2003-05-31 Thread Dave Whipp
, but I'm still not sure how it would fly. Actually, I think that both have pretty-much the same problems. I assume @Dan could work out a way to get the mechanics to work (basically a mugging: we kill a thread/coro and steal its continuation point). But the semantics of the cleanup could cause a world of pain. But realistically, a common use of a timeout is to kill something that's been going on too long. I suppose we could require some level of cooperation the the "dead" code. Dave.

Re: interthread signaling

2003-06-03 Thread Dave Whipp
Luke Palmer wrote: I think it would fall trivially out of the events mechanism, which is planned for Parrot. I have heard rumours of such a thing, but no details of how it will be exposed in the language... Dave.

Re: MMD [was Re: This week's summary]

2003-06-09 Thread Dave Whipp
with the main point you were wanting to make: a class-based multimethod really should make the primary invocant ($self) implicit -- if doing so doesn't make things even more confusing/ambiguous/nasty. Dave.

interthread signaling

2003-06-03 Thread Dave Whipp
"Piers Cawley" <[EMAIL PROTECTED]> wrote > Threads and Progress Monitors > Dave Whipp had some more thread questions, and wondered what would be a > good Perl 6ish way of implementing a threaded progress monitor. Whilst > the discussion of all this was in

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Michael Zedeler wrote: This is exactly why I keep writing posts about Ranges being defunct as they have been specified now. If we accept the premise that Ranges are supposed to define a kind of linear membership specification between two starting points (as in math), it doesn't make sense that

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Moritz Lenz wrote: Dave Whipp wrote: for 0..10 -> $x { ... } is treated as for (0...10).pick(*) -> $x { ... } Sorry, I have to ask. Are you serious? Really? Ah, to reply, or not to reply, to rhetorical sarcasm ... In this case, I think I will: Was my specific proposal en

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Moritz Lenz wrote: I fear what Perl 6 needs is not to broaden the range of discussion even further, but to narrow it down to the essential points. Personal opinion only. OK, as a completely serious proposal, the semantics of "for 0..10 { ... }" should be for the compiler to complain "sorry, t

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Aaron Sherman wrote: On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is, for 0..10 -> $x { ... } is treated as

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Darren Duncan wrote: Dave Whipp wrote: Similarly (0..1).Seq should most likely return Real numbers No it shouldn't, because the endpoints are integers. If you want Real numbers, then say "0.0 .. 1.0" instead. -- Darren Duncan That would be inconsistent. $x ~~ 0..1 means 0

Re: Pragma to change presentation of numbers in Perl 6.

2010-09-02 Thread Dave Whipp
Matthew wrote: use base 16; my $a = 10; say $a; puts the number 0x10 into $a, and outputs `10'. Here, say $a.fmt('%d') would output `16'. As someone who has implemented, and used, mini-languages with such a feature, I'd say that the confusion that it would cause does significantly outweigh

Re: threads?

2010-10-12 Thread Dave Whipp
Damian Conway wrote: Perhaps we need to think more Perlishly and reframe the entire question. Not: "What threading model do we need?", but: "What kinds of non-sequential programming tasks do we want to make easy...and how would we like to be able to specify those tasks?" The mindset that I u

Re: Tweaking junctions

2010-10-22 Thread Dave Whipp
Damian Conway wrote: I've been thinking about junctions, and I believe we may need a small tweak to (at least) the jargon in one part of the specification. When this issue has been raised in the past, the response has been that junctions are not really intended to be useful outside of the narr

Re: Tweaking junctions

2010-10-25 Thread Dave Whipp
lete implementation of a module implementing them, which runs successfully on the current release of Rakudo*. I append said model for your amusement (and suggestions!). ++ Dave.

Re: Tweaking junctions

2010-10-25 Thread Dave Whipp
Damian Conway wrote: Yes, Ted Z. pointed out to me that, as the name of this construct, "every" has ambiguity and synonym issues. Other possibilities are: select(@values) < one(3..7) those(@values) < one(3..7) whichever(@values) < one(3..7) itemize(@values) < one(3..7) extra

Re: Tweaking junctions

2010-11-01 Thread Dave Whipp
uot;core" functionality that I'll be able to implement something like this as a module. So I don't push it except when someone else starts a thread about the "values of a junction" :). Dave.

Re: exponentiation of Duration's

2010-11-18 Thread Dave Whipp
On 11/17/2010 10:08 PM, Martin D Kealey wrote: Dimensioned numbers as restrictive types are useful, for uncovering bugs, including sometimes latent ones in ported code. Duration is a fairly clear example of a dimensioned quantity, and I think we should think twice about abandoning its dimension

<    1   2   3   4   5