Re: Synopsis 4 draft 1

2004-09-03 Thread Larry Wall
On Fri, Sep 03, 2004 at 02:56:48PM +0100, Peter Haworth wrote: : n-ary zip() is simple enough, but the infix ? makes zipping more than : two lists somewhat entertaining. Without iterators doesn't work well: : : @a ? @b produces (@a[0],@b[0],@a[1],@b[1],...) : : which is what we wanted, but : :

Re: Synopsis 4 draft 1

2004-09-03 Thread Peter Haworth
On Thu, 19 Aug 2004 19:45:37 -0700, Larry Wall wrote: > To process two arrays in parallel, use either the zip function: > > for zip(@a,@b) -> $a, $b { print "[$a, $b]\n" } > > or the "zipper" operator to interleave them: > > for @a ¥ @b ¥ @c -> $a, $b, $c { print "[$a, $b, $c]\n" } n-ary z

Re: Synopsis 4 draft 1

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 12:39:35AM -0700, Brent 'Dax' Royal-Gordon wrote: : Larry, you're a genius. Yeah, well, that and 150 cents'll get me a cup of coffee... Larry

Re: Synopsis 4 draft 1 -- const block params and placeholders

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 09:04:48AM -0700, Dave Whipp wrote: : > Parameters are by default constant within the block. You can : > declare a parameter read/write by including the "C" trait. : > If you rely on C<$_> as the implicit parameter to a block, then : > then C<$_> is considered read/write by

Re: Synopsis 4 draft 1

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 09:18:06AM -0500, Jonathan Scott Duff wrote: : Whither REDO {...} ? Or do we just manufacture that ourselves with : NEXT? Hmm, well, you can view C as just a C in disguise, or as a C that suppresses the "while" check. But I think it's seldom enough used that it doesn't r

Re: Synopsis 4 draft 1

2004-08-20 Thread Luke Palmer
Aaron Sherman writes: > Larry Wall wrote: > > leave :from(Loop) :labelÂLINEÂ <== 1,2,3; > > [...] > > leave <== :foo:bar:baz(1) if $leaving; > > I know it's probably just me, but This section seems to suddenly rely on > a lot more knowledge of the current state of Perl 6 syntax than I have.

Re: Synopsis 4 draft 1 -- const block params and placeholders

2004-08-20 Thread Dave Whipp
> Parameters are by default constant within the block. You can > declare a parameter read/write by including the "C" trait. > If you rely on C<$_> as the implicit parameter to a block, then > then C<$_> is considered read/write by default. That is, > the construct: > > for @foo {...} > > is a

Re: Synopsis 4 draft 1

2004-08-20 Thread Jonathan Scott Duff
On Thu, Aug 19, 2004 at 07:45:37PM -0700, Larry Wall wrote: > BEGIN {...}*at compile time, ASAP > CHECK {...}*at compile time, ALAP >INIT {...}*at run time, ASAP > END {...} at run time, ALAP > FIRST {...}*at first block entry time > ENTER

Re: Synopsis 4 draft 1

2004-08-20 Thread Aaron Sherman
Larry Wall wrote: =head1 Title Synopsis 4: a Summary of Apocalypse 4 A little light reading is always good in the morning ;-) To return a value from a pointy sub or bare closure, you either just mention the value last that you want to return, or you can use C. A C by default exits from the inne

Re: Synopsis 4 draft 1

2004-08-20 Thread Brent 'Dax' Royal-Gordon
Larry Wall <[EMAIL PROTECTED]> wrote: > Final blocks on statement-level constructs always imply semicolon > precedence afterwards regardless of the position of the closing curly. > Statement-level constructs are distinguished in the grammar by being > declared in the statement syntactic group: > >

Synopsis 4 draft 1

2004-08-19 Thread Larry Wall
=head1 Title Synopsis 4: a Summary of Apocalypse 4 =head1 Author Larry Wall <[EMAIL PROTECTED]> =head1 Version Maintainer: Date: Last Modified: Number: 4 Version: 0 This document summarizes Apocalypse 4, which covers the block and statement syntax of Perl. =head1 The Rela