On Wed Jul 14 15:42:09 2010, cognominal wrote:
> Sorry. My example was wrong. Here another one.  C<a([])> executes as
> intended but
> C<@t> does not. I find that unintuitive.
> 
> 
> cat mmd5.pm6
> multi sub a(@a) { say 1 ~ @a.perl }
> multi sub a([]) { say 2 ~ [].perl }
> my @t=(1,2);
> a([]);
> a(@t)
> $ perl6 mmd5.pm6
> 2[]
> No applicable candidates found to dispatch to for 'a'. Available
> candidates are:
> :(@a)
> :(Positional  ())
> 
>   in main program body at line 5:mmd5.pm6
> $
> 

This works now:

$ cat foo
multi sub a(@a) { say 1 ~ @a.perl }
multi sub a([]) { say 2 ~ [].perl }
my @t=(1,2);
a([]);
a(@t)
$ ./perl6 foo
1Array.new()
1Array.new(1, 2)

Closable with tests.

-- 
Will "Coke" Coleda

Reply via email to