Re:Infinite work is less work
by yellowapple on Thursday July 11, 2019 @03:52PM
(#20415125)
You only need the sigil during definition. So, for example (in the Perl 6 REPL):
There are some implications of this; namely: x and y are now immutable. Back in the REPL:
This is because in Perl6 the sigil is a container for the value represented by that variable, so since you don't have a sigil, you don't have a container; that is: the names "x" and "y" are now literal synonyms for "1" and "2" (respectively). "x = 2" fails here for the same exact reason (and with the same exact error message) you'd get if you tried to do "1 = 2".
[ Parent
| on HN ]
Sweet explanation ;-)!
For those interested on learning more about containers in Raku, lizmat wrote a nice article about them [1]. There's also this documentation page [2] that gives a detailed overview of them, where you can find more about sigilless variables.