More A5/E5 questions

2002-09-06 Thread Jonathan Scott Duff
Question #1: If \n matches any one of the platform-specific newline character sequences, does that mean that if I have a string like this[*]: "foo bar baz\rfoo bar baz\nfoo bar bar\r\n" that \n will match in 3 places? How do you tell perl that you only want \n to match a specific newl

Re: More A5/E5 questions

2002-09-06 Thread Luke Palmer
Answering to the best of my knowledge. On Sat, 7 Sep 2002, Jonathan Scott Duff wrote: > Question #2: > > Why are we storing the hypothetical's sigil in the match object? I think it's to differentiate the different namespaces (scalar, array, hash) within the match object's hash. Personally,

Re: More A5/E5 questions

2002-09-07 Thread Nicholas Clark
On Fri, Sep 06, 2002 at 11:27:59PM -0600, Luke Palmer wrote: > > Answering to the best of my knowledge. > > On Sat, 7 Sep 2002, Jonathan Scott Duff wrote: > > > Question #2: > > > > Why are we storing the hypothetical's sigil in the match object? > > I think it's to differentiate the differen

Re: More A5/E5 questions

2002-09-09 Thread David Helgason
Jonathan Scott Duff wrote: > Question #3: > > Related to question #2, if I didn't use hypotheticals, how would I > access the Nth match of a repitition? For instance, in E5, there's an > example that looks like this: > > rule file { ^ @adonises := * $ } > > If I didn't have the hypoth

Re: More A5/E5 questions

2002-09-09 Thread Damian Conway
Nicholas Clark wrote: > Related, I think: no-one answered my question about what happens when I > define > > sub dumb ($var, @var) { > ... > } > > and then call it with the pair var=>$thing Exception, probably. Perhaps the error would be something like: "Dumb ambiguous binding of dumb named

Re: More A5/E5 questions

2002-09-09 Thread Damian Conway
David Helgason wrote: > [worry #1] > The hypothetical 'variables' we bind to aren't really variables but keys to a hash. Welcome to Perl 6. Where *no* variable is really a variable, but all are keys to a hash (which is known as the symbol table) ;-) > Thus they shouldn't have sigils in thei

Re: More A5/E5 questions

2002-09-09 Thread Nicholas Clark
On Sun, Sep 08, 2002 at 09:50:45PM +0200, Damian Conway wrote: > Nicholas Clark wrote: > > > Related, I think: no-one answered my question about what happens when I > > define > > > > sub dumb ($var, @var) { > > ... > > } > > > > and then call it with the pair var=>$thing > > Exception, prob

Re: More A5/E5 questions

2002-09-09 Thread David Helgason
Damian Conway Wrote: >> [worry #1] >> The hypothetical 'variables' we bind to aren't really variables >> but keys to a hash. >Welcome to Perl 6. Where *no* variable is really a variable, but > all are keys to a hash (which is known as the symbol table) ;-) Ok, you're obviously right. But $0

Re: More A5/E5 questions

2002-09-09 Thread Damian Conway
David Helgason wrote: > Coming to think of it, why have a named variable at all? If the > match object gets returned anyhow there is no need for a cleverly > named magical variable ($0, $MATCH, ...). Probably for the same reason that we have $1, $2, $_, etc. Because people are lazy. :-) Damia

Re: More A5/E5 questions

2002-09-09 Thread Jonathan Scott Duff
On Mon, Sep 09, 2002 at 03:52:30PM +0200, Damian Conway wrote: > Hi Scott, > > You asked (off-list): Oops, that should've been on-list so that everyone can benefit from my ignorance :-) > > Then how do I tell ^^ and $$ to only match just after and just before > > my platform specific newline s