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

2002-12-11 Thread Dan Sugalski
At 9:43 PM -0700 12/11/02, Luke Palmer wrote: > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm X-Sent: 11 Dec 2002 23:16:30 GMT Date: Thu, 12 Dec 2002 10:16:26 +1100 From: Damian Conway <[EMAIL PROTECTED]> X-Accept-Language: en, en-us X-SMTPD: qpsmtpd/0.20, http://develooper.com/code

Re: right-to-left pipelines

2002-12-11 Thread Dan Sugalski
At 3:24 AM + 12/12/02, Simon Cozens wrote: [EMAIL PROTECTED] (Deborah Ariel Pickett) writes: > Can we dictate that parentheses are optional in this case, and demand parentheses in all others? You see, the problem is that if we don't know what method we're going to call until way after we'

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

2002-12-11 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > From: "Dave Whipp" <[EMAIL PROTECTED]> > Date: Wed, 11 Dec 2002 14:54:18 -0800 > Organization: Fast-Chip inc. > X-Priority: 3 > X-MSMail-Priority: Normal > X-Newsreader: Microsoft Outlook Express 5.50.4920.2300 > X-MimeOLE: Produced By Micro

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

2002-12-11 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > X-Sent: 11 Dec 2002 23:16:30 GMT > Date: Thu, 12 Dec 2002 10:16:26 +1100 > From: Damian Conway <[EMAIL PROTECTED]> > X-Accept-Language: en, en-us > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > There's no need for special m

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

2002-12-11 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Date: Wed, 11 Dec 2002 19:21:35 -0500 > From: John Siracusa <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > On 12/11/02 6:16 PM, Damian Conway wrote: > > There's no need for

Re: right-to-left pipelines

2002-12-11 Thread Jonathan Scott Duff
On Wed, Dec 11, 2002 at 07:08:58PM -0800, Brent Dax wrote: > But when you know the type beforehand, there shouldn't *be* any > ambiguity. You can see the methods in that class, and you know how many > arguments the biggest implementation of a multimethod[1] takes. Just > assume that that's the on

Re: superposed parsers (was: right-to-left pipelines)

2002-12-11 Thread Stephen McCamant
> "Simon" == Simon Cozens <[EMAIL PROTECTED]> writes: Simon> [EMAIL PROTECTED] (Damian Conway) writes: Damian> But in Perl 6, the consistency between a method's parameter Damian> list and its argument list *is* checked at run-time, so Damian> passing the wrong number of arguments is (quite li

Re: right-to-left pipelines

2002-12-11 Thread Tanton Gibbs
> As I said, I wasn't sure whether or not I was being serious at this point. > > > > > method bar($x, $y) { > > > > method bar($z) { # note 1 > > > Oh, bringing in multimethods Just Isn't Fair. > > > > Those are multimethods? Migod, I feel like a person who's just > > discovered for t

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Deborah Ariel Pickett) writes: > About this point was when my brain when "a ha!". But I'm not yet > convinced that generating all possible parses is (a) of sane time > complexity, and (b) a little *too* DWIM for its own good. As I said, I wasn't sure whether or not I was being

Re: right-to-left pipelines

2002-12-11 Thread Deborah Ariel Pickett
Simon Cozens wrote: > [EMAIL PROTECTED] (Deborah Ariel Pickett) writes: > > That works, with one big proviso. You have to have predeclared all > > possible methods in the class to which the object belongs, AND each > > method in that class (and all defined subclasses) has to have a unique > > sign

RE: right-to-left pipelines

2002-12-11 Thread Brent Dax
Uri Guttman: # BD> Fine. In Perl 5 we have a restriction on when you can # and can't use # BD> parens on a subroutine--you can omit them when the sub # is predeclared, # BD> and Perl will assume that no magic is going on. I see # nothing wrong # BD> with this rule. # # but you are con

Re: Everything is an object.

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Michael Lazzaro) writes: > Wel... yes and no. You can make the same argument for operators > upon scalars, for example, since 'scalar' is arguably no more > universal than 'array'. And we could easily use that argument to > remove *all* builtins, period: Now you're getting

Re: REs as generators

2002-12-11 Thread Randal L. Schwartz
> "Rich" == Rich Morin <[EMAIL PROTECTED]> writes: Rich> On occasion, I have found it useful to cobble up a "little language" Rich> that allows me to generate a list of items, using a wild-card or some Rich> other syntax, as: Rich>foo[0-9][0-9] yields foo00, foo01, ... Rich> I'm wonderi

Re: Everything is an object.

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 06:41 PM, Michael Lazzaro wrote: print $i; # ILLEGAL; use $STDOUT.print($i) or $i.print (?) reverse @a; # ILLEGAL; use @a.reverse; map {...} @a; # ILLEGAL; use @a.map({...}); sort {...} @a; # keys %h;# ...etc... (And yes,

Re: Everything is an object.

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 05:39 PM, Simon Cozens wrote: [EMAIL PROTECTED] (Michael Lazzaro) writes: would be a false savings. If a method _is_ universal, especially if it's symmetric, it might be an OK candidate for a builtin or operator. And if it isn't universal, I can see (almost)

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Deborah Ariel Pickett) writes: > That works, with one big proviso. You have to have predeclared all > possible methods in the class to which the object belongs, AND each > method in that class (and all defined subclasses) has to have a unique > signature. No! No, no, no! You're

Re: right-to-left pipelines

2002-12-11 Thread Deborah Ariel Pickett
> [EMAIL PROTECTED] (Damian Conway) writes: > > But in Perl 6, the consistency between a method's parameter list and its > > argument list *is* checked at run-time, so passing the wrong number of > > arguments is (quite literally) fatal. > But wait! If we can check how many parameters to pass, we k

Re: right-to-left pipelines

2002-12-11 Thread Uri Guttman
> "BD" == Brent Dax <[EMAIL PROTECTED]> writes: BD> Fine. In Perl 5 we have a restriction on when you can and can't use BD> parens on a subroutine--you can omit them when the sub is predeclared, BD> and Perl will assume that no magic is going on. I see nothing wrong BD> with this rul

Re: Everything is an object.

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Michael Lazzaro) writes: > would be a false savings. If a method _is_ universal, especially if > it's symmetric, it might be an OK candidate for a builtin or operator. > And if it isn't universal, I can see (almost) no justification for > wasting an op on it, no matter how commo

Re: Everything is an object.

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 05:21 PM, Michael G Schwern wrote: On Wed, Dec 11, 2002 at 04:56:03PM -0800, Michael Lazzaro wrote: First, universal operators and universal methods both pollute the useful (programmer) namespace to nearly the same extent. Most of the methods are not unive

Re: Everything is an object.

2002-12-11 Thread Michael G Schwern
On Wed, Dec 11, 2002 at 04:56:03PM -0800, Michael Lazzaro wrote: > First, universal operators and universal methods both pollute the > useful (programmer) namespace to nearly the same extent. Most of the methods are not universal. For example: $foo.compress would be in the String class, n

Re: Everything is an object.

2002-12-11 Thread Dave Whipp
"Simon Cozens" <[EMAIL PROTECTED]> wrote > Verbs are almost always associated with their subject in OO languages, > so I don't see where you're coming from. Actually, the important part of it was the 3rd option (the multimethod): sometimes the association is symmetrical. I was pointing out that t

Re: Everything is an object.

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 03:27 PM, Michael G Schwern wrote: There's lots of reasons to use an operator or built-in instead of a method, but remember to make the consideration first. Don't go grammar happy. I agree 98% with your argument (especially re: grammar extensions), and it

Re: Comparing Object Identity

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Michael Lazzaro) writes: > I think that is covered by C<~~>. As long as we can create > class-specific variants of smart matching, we're fine. If we can't, case^Wgiven statements become very boring indeed. For reference, and purely for reference, Ruby has four object comparato

Re: Everything is an object.

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Dave Whipp) writes: > There is a difference between verbs and noun. Sometimes you don't want > to associate a verb with an object: you want to associate it with the > subject: Verbs are almost always associated with their subject in OO languages, so I don't see where you're comi

Re: Comparing Object Identity

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 02:54 PM, Dave Whipp wrote: There's actually a fourth concept: two (different) objects represent the same value. (Actually, its the generalization of [1] and [2]). I think that is covered by C<~~>. As long as we can create class-specific variants of smart

Re: Everything is an object.

2002-12-11 Thread Dave Whipp
"Michael G Schwern" <[EMAIL PROTECTED]> wrote: > This is just your friendly neighborhood curmudgeon reminding you that in > Perl 6, everything is an object > ... > Instead of introducing new built-in functions they can be done as methods. The problem with this worldview is that you end up with hor

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

2002-12-11 Thread John Siracusa
On 12/11/02 6:16 PM, Damian Conway wrote: > There's no need for special methods or (gods forbid) more operators. > Just: > >$obj1.id == $obj2.id > > That's what the universal C method is *for*. I must have missed this (or forgotten it?) Any chance of it becoming .ID or .oid or even ._id? I

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Damian Conway) writes: > But in Perl 6, the consistency between a method's parameter list and its > argument list *is* checked at run-time, so passing the wrong number of > arguments is (quite literally) fatal. But wait! If we can check how many parameters to pass, we know how m

RE: right-to-left pipelines

2002-12-11 Thread Brent Dax
Simon Cozens: # Are you taking full account of what sort of magic may be # performed between the two statements? :) # # Urgh: # my Foo $foo; # my Bar $bar; # $foo := $bar; # Compile-time error? Eww, gross. # Also, Foo might change its nature, be replaced, import new # m

Re: right-to-left pipelines

2002-12-11 Thread Damian Conway
Simon Cozens wrote: I was explaining why I think we ought to keep the parens. And that is because, without them, we can't tell how many arguments to pass to the method. Not if it is specified that a block comes after the final argument. The only way that this could be specified is with a sig

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Brent Dax) writes: > # my Foo $foo; > # > # # and later in the same lexical scope... > # > # $foo.bar(); > Your point being...? Shouldn't it only dispatch to methods defined in > Foo? Are you taking full account of what sort of magic may be performed between the

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Iain 'Spoon' Truskett) writes: > So why does Ruby have so little trouble with it? Because the Ruby designer(s) don't have fifteen years of Perl experience muddling up their heads. :) But seriously, Ruby does something a little tricky here that Perl 6 should probably *not* foll

RE: right-to-left pipelines

2002-12-11 Thread Brent Dax
Damian Conway: # that determine which method is called. Even if you write: # # my Foo $foo; # # # and later in the same lexical scope... # # $foo.bar(); # # there's no way at compile time of knowing what class of # object $foo contains. It could be a Foo object, or it could

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Damian Conway) writes: > You underestimate your ability to communicate, Simon. I understood > exactly what you wanted: pass a closure to a method without needing > to wrap the closure in parens. Fair enough. > I was explaining why I think we ought to keep the parens. And that

Re: right-to-left pipelines

2002-12-11 Thread Iain 'Spoon' Truskett
* Damian Conway ([EMAIL PROTECTED]) [12 Dec 2002 10:32]: [...] > You underestimate your ability to communicate, Simon. I understood > exactly what you wanted: pass a closure to a method without needing to > wrap the closure in parens. Simon appears to want to have closures as params just like Rub

Re: Everything is an object.

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Michael G Schwern) writes: > If you want a tactile grasp of the "Everything is an object" concept, try > some Ruby. If you want a tactile grasp of Perl 6, try some Ruby. But I'll be saying a lot more on that later... > A flip through the Ruby builtin methods is nice for buildi

Re: REs as generators

2002-12-11 Thread Damian Conway
Dave Storrs wrote: 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

Re: right-to-left pipelines

2002-12-11 Thread Damian Conway
Simon Cozens wrote: *Why* do methods need their parens? Because calls to them are not resolved until run-time and because methods can be overloaded by signature, so we can't tell at parse time what the parameter list of the called method will be (i.e. where it will end), so we can't determine h

Everything is an object.

2002-12-11 Thread Michael G Schwern
This is just your friendly neighborhood curmudgeon reminding you that in Perl 6, everything is an object. This is a concept that, as Perl programmers, we're not familiar with. What are the consequences of this in language design? Well, it means not every new piece of functionality requires a new

Re: REs as generators

2002-12-11 Thread Damian Conway
Luke Palmer asked: Can junctions have methods? If we decide they can, yes. ;-) How do you tell the difference between calling a junction's method and > calling a method on each of its states? If it's a method of the class Junction (or one of its four subclasses) then it's a method call on

Re: right-to-left pipelines

2002-12-11 Thread Damian Conway
Michael Lazzaro asked: All subroutines with multiple signatures would have this problem, right, even normal non-method subs? foo $a, $b, $c, $d; # how many args? Yep. Can't be known unless predeclared and hence compile-time discernible. And methods can't be discerned in the presence of r

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

2002-12-11 Thread Buddha Buck
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 ':=:' to do it. Definitely '==='. I could also see :== or =:= as well. If we have $obj1 = $obj2; then presumably, ($obj1

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

2002-12-11 Thread Damian Conway
There's no need for special methods or (gods forbid) more operators. Just: $obj1.id == $obj2.id That's what the universal C method is *for*. Damian

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

2002-12-11 Thread Dan Sugalski
At 2:28 PM -0800 12/11/02, Michael G Schwern wrote: On Wed, Dec 11, 2002 at 02:15:40PM -0800, Michael Lazzaro wrote: On Wednesday, December 11, 2002, at 11:16 AM, Luke Palmer wrote: >This brings up something that's been on the tip of my toungue for >awhile. In many object-oriented languages

RE: Stringification of references (Decision, Please?)

2002-12-11 Thread Brent Dax
Michael Lazzaro: # Piers wrote: # I doggishly maintain my preference for treating "stringification for # output" and "stringification for debugging" differently, but # as long as # I can specify an "AS_STRING" (sp?) method for a class, and # _still_ get # at a debugging version to print to oth

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

2002-12-11 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > After thinking about it a little more, I'll set myself on the "yes" > side. And propose either '===' or ':=:' to do it. Definitely '==='. This is used in various other languages. > >$obj1 eq $obj2;# [1] are their stringifications identical?

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

2002-12-11 Thread Michael G Schwern
On Wed, Dec 11, 2002 at 02:15:40PM -0800, Michael Lazzaro wrote: > On Wednesday, December 11, 2002, at 11:16 AM, Luke Palmer wrote: > >This brings up something that's been on the tip of my toungue for > >awhile. In many object-oriented languages we have seen that there is > >an important differen

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

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 11:16 AM, Luke Palmer wrote: This brings up something that's been on the tip of my toungue for awhile. In many object-oriented languages we have seen that there is an important difference between "equal" and "same." Perl already has two kinds of equal, but I

Re: right-to-left pipelines

2002-12-11 Thread Dan Sugalski
At 10:41 AM -0800 12/11/02, Michael Lazzaro wrote: How much overhead do we expect (runtime) multimethods to have? I would guess it to be nontrivial, e.g. substantially worse than normal methods... I'd expect a non-trivial overhead to start, declining with time, only paid when calling methods

Re: Stringification of references (Decision, Please?)

2002-12-11 Thread John Siracusa
On 12/11/02 2:04 PM, Michael Lazzaro wrote: > On Wednesday, December 11, 2002, at 10:36 AM, John Siracusa wrote: >> Maybe "AS_STRING" and "AS_STRING_DEBUG"? Too long? "DEBUG_STRING"? >> Are we married to the "AS_*" thing? > > Not really -- whatever works. We also had .debug, .identity, and .id

Re: Stringification of references (Decision, Please?)

2002-12-11 Thread Luke Palmer
> Date: Wed, 11 Dec 2002 10:10:05 -0800 > From: Michael Lazzaro <[EMAIL PROTECTED]> > > (I also beg people to stop thinking about testing for > equality/equivalence between two objects as being related to their > stringification. You shouldn't be stringifying objects merely to test > if they'r

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

2002-12-11 Thread Luke Palmer
> Date: Tue, 10 Dec 2002 08:04:46 -0800 > From: Dave Storrs <[EMAIL PROTECTED]> > > On Mon, Dec 09, 2002 at 03:58:54PM -0700, Luke Palmer wrote: > > > From: Dave Storrs <[EMAIL PROTECTED]> > > > My understanding was that in Perl6, you could use pretty much anything > > > for a hashkey--string, num

Re: Stringification of references (Decision, Please?)

2002-12-11 Thread Michael Lazzaro
(BOn Wednesday, December 11, 2002, at 10:36 AM, John Siracusa wrote: (B> Maybe "AS_STRING" and "AS_STRING_DEBUG"? Too long? "DEBUG_STRING"? (B> Are we married to the "AS_*" thing? (B (BNot really -- whatever works. We also had .debug, .identity, and .id (Bproposed, for example. (B (

Re: how to code a lazy pipeline?

2002-12-11 Thread Mark Biggar
Richard J Cox wrote: On Tuesday, December 10, 2002, 1:26:41 PM, you (mailto:[EMAIL PROTECTED]) wrote: On 12/10/2002 4:54 AM, Me wrote: How would one most nicely code what I'll call a lazy pipeline, such that the first result from the final element of the pipeline can appear as soon as the firs

Re: right-to-left pipelines

2002-12-11 Thread Michael Lazzaro
On Tuesday, December 10, 2002, at 02:50 PM, Damian Conway wrote: Simon Cozens asked: *Why* do methods need their parens? *All* of them might be valid interpretations, and *none* of them might be known to be valid (or even knowable) at the point where the code is parsed. Throw multimethods i

Re: Stringification of references (Decision, Please?)

2002-12-11 Thread John Siracusa
On 12/11/02 1:10 PM, Michael Lazzaro wrote: > I doggishly maintain my preference for treating "stringification for > output" and "stringification for debugging" differently, but as long as > I can specify an "AS_STRING" (sp?) method for a class, and _still_ get > at a debugging version to print to

Re: how to code a lazy pipeline?

2002-12-11 Thread Richard J Cox
On Tuesday, December 10, 2002, 1:26:41 PM, you (mailto:[EMAIL PROTECTED]) wrote: > On 12/10/2002 4:54 AM, Me wrote: >> How would one most nicely code what I'll call >> a lazy pipeline, such that the first result >> from the final element of the pipeline can >> appear as soon as the first result has

Stringification of references (Decision, Please?)

2002-12-11 Thread Michael Lazzaro
Piers wrote: Stringification of references Joseph F. Ryan kicked off a discussion of the stringification of objects and references and offered his suggestions. Joseph leans towards having the default stringifications of objects and references provide information useful to the programmer. I ag

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

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

2002-12-11 Thread Dave Storrs
On Mon, Dec 09, 2002 at 03:58:54PM -0700, Luke Palmer wrote: > > From: Dave Storrs <[EMAIL PROTECTED]> > > My understanding was that in Perl6, you could use pretty much anything > > for a hashkey--string, number, object, whatever, and that it did not > > get mashed down into a string. Did I have t

how to code a lazy pipeline?

2002-12-11 Thread Ralph Mellor
How would one most nicely code what I'll call a lazy pipeline, such that the first result from the final element of the pipeline can appear as soon as the first result has been processed from the intervening elements? -- ralph

Re: REs as generators

2002-12-11 Thread Dave Storrs
On Tue, Dec 10, 2002 at 03:38:58PM -0800, Rich Morin wrote: > On occasion, I have found it useful to cobble up a "little language" > that allows me to generate a list of items, using a wild-card or some > other syntax, as: > > foo[0-9][0-9] yields foo00, foo01, ... > > I'm wondering whether Pe

Re: right-to-left pipelines

2002-12-11 Thread Richard Proctor
On Wed 11 Dec, Simon Cozens quoted: > No proper program contains an indication which as an operator-applied > occurrence identifies an operator-defining occurrence which as an > indication- applied occurrence identifies an indication-defining occurrence > different from the one identified by the g

Re: right-to-left pipelines

2002-12-11 Thread Simon Cozens
[EMAIL PROTECTED] (Damian Conway) writes: > > *Why* do methods need their parens? > > Because calls to them are not resolved until run-time and because methods > can be overloaded by signature, so we can't tell at parse time what the > parameter list of the called method will be (i.e. where it wil

This week's summary

2002-12-11 Thread p6summarizer
The Perl 6 Summary for the week ending 20021208 Another Monday evening. Another summary to write. Starting, as is becoming tediously predictable, with perl6-internals. Another JIT discussion Toward the end of the previous week, Leopold Tötsch posted something about the latest ro

Re: REs as generators

2002-12-11 Thread Luke Palmer
> Date: Wed, 11 Dec 2002 19:15:53 +1100 > From: Damian Conway <[EMAIL PROTECTED]> > > I suspect C may be a method only, so that would be either: > >my @foos = states $foos:; > > or: > >my @foos = $foos.states; > > Though, I suppose we might argue that C is as fundamental to Per

Re: right-to-left pipelines

2002-12-11 Thread Piers Cawley
Ken Fox <[EMAIL PROTECTED]> writes: > Damian Conway wrote: >> For that reason, even if we can solve this puzzle, it might be far kinder >> just to enforce parens. > > I might be weird, but when I use parens to clarify code in Perl, I > like to use the Lisp convention: > >(method $object args)

Re: REs as generators

2002-12-11 Thread Rich Morin
At 10:37 PM -0700 12/10/02, Luke Palmer wrote: Why use regexen when you can just use junctions? my $foos = 'foo' ~ any(0..9) ~ any(0..9); ... We have a I language on our hands, people. Agreed, but this solution doesn't work well for all cases. For example, what if I want to iterate throug

Re: REs as generators

2002-12-11 Thread Damian Conway
Luke Palmer wrote: LP> my $foos = 'foo' ~ any(0..9) ~ any(0..9); Actually $foos will be a junction. You could use C to get each state out of the junction in an array. my @foos = states $foos; Luke's right on target (as usual :-). Just one slight niggle. I suspect C may be a method