John M. Dlugosz wrote:
Perl 6 doesn't have references anymore, it has captures. So, what
does the following mean:
Captures themselves are immutable, but the underlying data that they
reference is not. Thus the laziness, or at least that's what I
understand it to mean. I'm sure I read something along these lines in a
synopsis, probably S02.
@x = <foo bar>;
$a = [1, 2, [EMAIL PROTECTED];
I imagine that the 3rd element of the Array is itself an Array, and is
the same object that is bound to @x. But captures are lazy
context-sensitive beasts, so I wonder if there is more poised to go on
than I want or care about in this example.
say $a === @x; #gives True
@x = "baz";
say $a; #gives baz