3 ms·
> The Sigils syntax does not resonate with me. I'm a Perl fan and I have to say that sigils should go. Or at least become optional. Most of the times it's ju
by grondilu 9y ago
> The Sigils syntax does not resonate with me.
I'm a Perl fan and I have to say that sigils should go. Or at least become optional.
Most of the times it's just one character too many.
Say you want to write an anonymous function with three arguments like f(a,b,c) = a+b c
In Perl (either 5 or 6), you could for instance write :
sub ($a, $b, $c) { $a+$b*$c }
It's not that long, but each "$" is kind of a visual stain that beclouds the variable name.
To me, it would make sense for instance that read-only variables would have no sigil. It's already the case in Perl 6 for constant, since you can write :
constant pi = 355/113;
but if you want sigilless parameter names, you have to use a backslash :
sub (\a, \b, \c) { a+b*c }
which is quite ugly.
Just make the sigils optional already.