« Perl6::FAQ::Capture - Capture objects | Main | Backing out from the backtracking track. »

2006.04.15

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

What's the relationship between the binding operator and Capture?

$x = \(1,2,3);
$x := (1,2,3);

Are these equivalent?

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.

The comments to this entry are closed.

December 2015

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

License