3 ms·
> and unfortunately context sensitivity of operators became much more prevalent in Perl 6 than Perl 5. What makes you think so? So far I was convinced of the
by perlgeek 13y ago
> and unfortunately context sensitivity of operators became much more prevalent in Perl 6 than Perl 5.
What makes you think so? So far I was convinced of the exact opposite.
Examples:
* Perl 5 has the same operator for bitwise string AND and for bitwise integer AND. Perl 6 has separate operators, reducing context sensitivity.
* Perl 5's reverse() operator reverses lists in list context, and strings in scalar context. Perl 6 has separate verbs for these operations (reverse and flip), thus reducing context sensitivity
* In Perl 5, context flows inwards, so operator can actually be context sensitive in the classical sense. In Perl 6, operators know nothing about their caller, thus they cannot be context sensitive in the same crazy way that some Perl 5 operators are.