And I totally don't get the binary := operator.
Apocalypse 3 says of the binary := operator "it treats the left side as a set of formal arguments exactly as if they were in the declaration of a function, and binds a set of arguments on the right hand side as though they were being passed to a function."
Which I have to admit I just don't understand. Later it's treated as an alias. Exegesis 3 affirms this understanding: "Perl 6 provides a more direct mechanism for aliasing one variable to another in this way: the :="
Great. But aside from being able to shorten names I'm typing out (which I can do with references, and will be able to do more easily in Perl6 with auto-dereferencing), what benefit do I get? Sadly, the examples cited are either from languages I don't use, or refer to swapping arrays. (which I'm not sure I get: Can't I do (@a , @b) = (@b, @a) now that lists either are or are not flattened?)
What is the scope of an alias? How does (@a, @b) := (@b, @a) differ from (@a, @b) = (@a, @b)?
Am I not understanding what an alias is? How is $bound := %data{$key} different than $bound = \%data{$key}
Are the parameters to an alias (Or "bound variable" which I guess is more appropriate) evaluated at evaluation time? Would $bound := %data{$key} give me a different $bound as $key changed?
I'm sure this is a very powerful construct, but I really feel I'm missing something.
In reply to Comprehending Binary := by swiftone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |