On Sat, Feb 05, 2005 at 02:08:32PM +0800, Autrijus Tang wrote: > Here's another quick question: In S03 zip() is used like this: > > for zip(@names, @codes) -> $name, $zip { ... } > > But in S04 it becomes: > > for zip(@a;@b) -> $a, $b { ... } > > Why semicolon? Is it a special form? Or am I missing something deeply > equivalent about semicolons and list separators?
So it turns out that A03 says that semicolons within "brackets" defaults to a list-of-list builder. Curiously, it is missing from S03, and the behaviour is not documented in detail. Currently I assume the "brackets" above listish generators -- (), [], {} -- but not blocks under list context. That is: sub foo { 1 ; 2 ; 3 } # returns 3 sub bar { ( 1 ; 2 ; 3 ) } # returns ([1],[2],[3]) Is this the correct understanding? If so, S03 needs to be patched to say that (and more). Thanks, /Autrijus/
pgpopp7jGG1s1.pgp
Description: PGP signature