2 ms·
I think sigils in Perl 6 denote variable scope at a glance; so you don't have to write self.X everywhere. Also you get to know if a variable is only block scop
by true_religion 11y ago
I think sigils in Perl 6 denote variable scope at a glance; so you don't have to write self.X everywhere.
Also you get to know if a variable is only block scope, method scope, class variable, etc.
- awwaiid 11y agoSigils in Perl 6 are rough type constraints on their content. More specifically, the indicate a Role. $x is unconstrained, @x does the Positional role, %x does the Associative role, &x does Callable. Twigils in Perl 6 are where the scope indicators come in, clarifying class instance vars, dynamic scope, and so on. So if I see %.foo I can tell you that this variable can be used as the Associative role, that it is scoped as an instance variable, and that it has an accessor with the same name. For more, see the first few sections of http://doc.perl6.org/language/variables http://doc.perl6.org/language/variables