Larry wrote: > : $shouldbe3 = (1,2,3) + 0; > > It's 3, though not for the reason a Perl 5 programmer would think. > (In Perl 6 it's the length of the anonymous array, not the > last value.)
This kind of clever magic always makes me nervous: it introduces subtle bug potentials. (7,8,9) == 3 # true (7,8) == 2 # true (7) == 1 # false () == 0 # true? As someone who regularly writes code generators -- and even as someone who occasionally edits code without thinking straight, I am certain that I will, on occasion, introduce bugs through this mechanism. If the [] list-ref composers are to remain, there seems no good reason to add a redundant behaviour to parentheses. Or am I missing something? Dave.