--
Johan Viklund
<viklund> perl6: say :foo<>.perl [08:17]
<p6eval> rakudo 30809: OUTPUT[("foo" => [])]
<p6eval> ..elf 22166: OUTPUT[Odd number of elements in anonymous hash at
./elf_f line 19.Pair.new(!!!)]
<p6eval> ..pugs: OUTPUT[*** Named argument found where no matched parameter
expected: (foo,Syn "," []) at /tmp/kGq5mr0wii line 1, column 1 -
line 2, column 1]
<viklund> hmm, that looks like a bug in rakudo to me, shouldn't the output be
("foo" => "") [08:18]
<viklund> irhd++ found it while hacking on november
<TimToady> well, pugs actually has it right :)
<viklund> ok
--
Johan Viklund
> I think it's a bug. But I'm not really sure, ask on #perl6 on freenode
> or submit a bugreport to rakudobug.
I don't think it's a bug. There is no clarity about this construction
in Synopsises. This is a quote from Synopsis 2:
http://dev.perl.org/perl6/doc/design/syn/S02.html
Likewise, if bound to a scalar parameter, <a b> will be treated as a
single list object, but if bound to a slurpy parameter, it will auto-
flatten.
But note that under the parenthesis-rewrite rule, a single value will
still act like a scalar value. These are all the same:
$a = < a >;
$a = ('a');
$a = 'a';
Perl need to split string in the <> to list and after this transform
list to scalar if list consist of 1 element. It doesn't say anything
about calling it like <> without anything inside angles. Maybe this
nothing treated like empty string, maybe as undef. So i don't thik
it's a bug :)
And pugs works, it has problems with operators priority, but it works
as Rakudo:
pugs> say (:foo<>).perl
("foo" => ())
2008/9/6 Dmitriy Dzema <dima...@gmail.com>:
2008/9/6 Dmitriy Dzema <dima...@gmail.com>:
>