Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote:
        > sub f2 (@y) {say @y.WHAT; say +...@y}; f2(Nil);

        Array()
        1
Why doesn't +...@y produce 0, not 1?  It's an empty list.
From rakudo:
        > sub f2 (@y) {say @y[0]}; f2(Nil);
        Nil()

Henry


Uh, @y is an Array of one item, that one item being Nil.

I think the intent was to be an empty list. Nil is not supposed to go into lists, but to become nothing when used in such a way. Wrapping Nil into a list when it wasn't a list at all to begin with is totally missing the point. And where did the wrapping Array come from? At its simplest, Nil is an object whose Positional personality shows an empty list, and that's what the @ variable uses.

--John


Reply via email to