pugs-comm...@feather.perl6.nl wrote:
> Author: ash
> Date: 2010-01-19 17:34:28 +0100 (Tue, 19 Jan 2010)
> New Revision: 29558
> 
> Added:
>    t/spec/S32-array/create.t
>    t/spec/S32-list/create.t
> Modified:
>    docs/Perl6/Spec/S32-setting-library/Containers.pod
> Log:
> Adding some tests for List.new, Array.new, &list() and adding a description 
> to S32-List and S32-Array
> 
> Modified: docs/Perl6/Spec/S32-setting-library/Containers.pod
> ===================================================================
> --- docs/Perl6/Spec/S32-setting-library/Containers.pod        2010-01-18 
> 06:08:15 UTC (rev 29557)
> +++ docs/Perl6/Spec/S32-setting-library/Containers.pod        2010-01-19 
> 16:34:28 UTC (rev 29558)
> @@ -120,6 +120,18 @@
>  
>  =over
>  
> +=item new
> +
> + our List multi method new(*...@args)
> +
> +Constructs a C<List> containing the arguments passed to the C<new> method.

Since the argument list is already a List (or very nearly), I don't see
much sense in this constructor.

> +=item list
> +
> + our List sub list(*...@args)
> +
> +Constructs a C<List> containing the arguments passed to the C<list> 
> subroutine.
> +
>  =item cat
>  
>   our Cat multi cat ( @values )


That will be rather surprising. Imagine

my @x = list 3, 4, :a<b>;

With the definition above that would give a run-time error (because
list() doesn't expect a named argument), but the programmer probably
expects a three-item list with a Pair as last item.

That's why people in #perl6 generally assume that list() is not a
function, but probably some kind of macro, or special-cased by the compiler.


Cheers,
Moritz

Reply via email to