RE: Split with negative limits, and other weirdnesses

2008-09-30 Thread Kealey, Martin, ihug-NZ
Hmmm, my understanding was that it stopped *splitting* after the limit, but it doesn't stop "consuming" the source; rather the entire remainder is returned as the last item in the list, even if it contains the delimiter. A bit like this: sub split($pat, $src, $limit) { @

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Jacinta Richardson
Carl Mäsak wrote: > Do not combine 'ne' and '|', like this: > > die "Unrecognized directive: TMPL_$directive" >if $directive ne 'VAR' | 'LOOP' | 'IF'; > One is tempted to assume that this means the same as "$directive ne > 'VAR' || $directive ne 'LOOP' || $directive ne 'IF"", but it doesn't.

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Martin D Kealey
On Tue, 30 Sep 2008, Patrick R. Michaud wrote: > Just for pedantic clarity, what C< $directive ne 'VAR' & 'LOOP' & 'IF' > > really gives is > > all( $directive ne 'VAR', $directive ne 'LOOP', $directive ne 'IF' ) > > In other words, the result of the expression is an all() Junction. In > boole

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Patrick R. Michaud
On Tue, Sep 30, 2008 at 02:31:46PM +1000, Jacinta Richardson wrote: > Carl Mäsak wrote: > > The "correct" form using junctions would be this: > > > > die "Unrecognized directive: TMPL_$directive" > >if $directive ne 'VAR' & 'LOOP' & 'IF'; > > which makes sense, because this does give us: > >