On Fri, 1 Sep 2000 07:27:24 +1100 (EST), Damian Conway wrote:

>  > > And has anyone pointed out that C<list> is just:
>   > > 
>   > >         sub list {@_}
>   > 
>   > Um no. I would expect it to be
>   > 
>   >   sub list { @_[0..$#_] }
>
>It's too early in the morning.
>The subtlety here escapes me.

It's the difference between an array and a list.

        sub array { @_ }
        sub list { @_[0..$#_] }
        @a = qw(a b c);
        $\ = "\n"
        print scalar array @a;
        print scalar list @a;
-->
        3
        c

I'm not sure if we want indeed the array or the list effect. Because, if
we do list, then in

        print scalar list qw(a b c);

the "list" will have no effect, it will print "c"; but in

        @a = qw(a b c);
        print scalar array @a;

the "array" has not effect, this prints "3".

-- 
        Bart.

Reply via email to