Skip Menu |

Subject: Silent Success On Missing Commas
Download (untitled) / with headers
text/plain 490b
If, when constructing a hash, a comma is ommited, that particular key will be missing from that hash and no error or warning is generated. This it LTA, as can be a source of hard-to-find bugs. Either comma-less assignment should Just Work or an error/warning should be generated. <Zoffix> m: my %h = :foo<bar> :ber<boor>, :meow<moo>; say %h <camelia> rakudo-moar b5cb00: OUTPUT«foo => bar, meow => moo␤» Relevant IRC conversation: http://irclog.perlgeek.de/perl6/2016-01-03#i_11822917
Download (untitled) / with headers
text/html 1022b
IIRC the idea was that in some cases you should be able to do this without commas. I don't think we need an RFC for this, somebody just has to implement it properly.

Also, I think there are several tickets related to this problem. Maybe worth looking for other ones.

On 2016-01-03 10:09:47, cpan@zoffix.com wrote:
Show quoted text
> If, when constructing a hash, a comma is ommited, that particular key
> will be missing from that hash and no error or warning is generated.
> This it LTA, as can be a source of hard-to-find bugs. Either comma-
> less assignment should Just Work or an error/warning should be
> generated.
>
> <Zoffix> m: my %h = :foo<bar> :ber<boor>, :meow<moo>; say %h
> <camelia> rakudo-moar b5cb00: OUTPUT«foo => bar, meow => moo␤»
>
> Relevant IRC conversation: http://irclog.perlgeek.de/perl6/2016-01-
> 03#i_11822917




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org