As promised yesterday, today gaal and I entered a gobby Q/A session, producing the first document under the Perl6::FAQ tree, on the newly coined Capture objects (previously known as Arguments) objects -- A HTMLized version is also available online.
With gaal's clearly-worded, carefully probing questions, I found myself discovering unforeseen consequences of the new design -- e.g. @y := (1,2,3) is actually an error, and one would need to say *@y := (1,2,3) instead.
Fortunately, the design seems to stand against the scrutiny. So after TimToady reported consent from @Larry on the s:g/Arguments/Capture/ name change, I committed that to the Synopses.
As this represents a rather drastic departure from Perl 5's model, I'd very much welcome reviews, comments, as well as more questions -- please feel free to commit directly to the FAQ file, and we'll pick up from there. :-)
What's the relationship between the binding operator and Capture?
$x = \(1,2,3);
$x := (1,2,3);
Are these equivalent?
Posted by: Dim. Lurker - drowning | 2006.04.16 at 02:14 AM
The only relationship is that the right hand side of a binding is implicitly a Capture expression, so
$x := (1,2,3)
is an error, becasue it's like calling a function accepting one parameter ($x) with three arguments (1,2,3). What would be equivalent with
$x = \(1,2,3)
is
\$x := (1,2,3)
Using the "\$" form of parameter sigil that captures everything on the binding side.
Posted by: Audrey T | 2006.04.16 at 12:13 PM