Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty {} or pair {1=>2} does not create anonymous hash in rakudo #195

Closed
p6rt opened this issue Jul 27, 2008 · 4 comments
Closed

Empty {} or pair {1=>2} does not create anonymous hash in rakudo #195

p6rt opened this issue Jul 27, 2008 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jul 27, 2008

Migrated from rt.perl.org#57340 (status was 'resolved')

Searchable as RT57340$

@p6rt
Copy link
Author

p6rt commented Jul 27, 2008

From @masak

From S06 <http://dev.perl.org/perl6/doc/design/syn/S06.html>&#8203;:

] {...} is always a block. However, if it is completely empty or consists
] of a single list, the first element of which is either a hash or a pair, it
] is executed immediately to compose a Hash object.
]
] [...]
]
] $obj = { 1=>2, 3=>4, 5=>6 }; # Anonymous hash

Rakudo is not up to spec on this point​:

$ ./perl6 -e 'my $a = { 1 => 2 }; say $a<1>'
get_pmc_keyed() not implemented in class 'Closure'
current instr.​: '_block11' pc 39 (EVAL_13​:21)
called from Sub 'parrot;PCT​::HLLCompiler;eval' pc 806
(src/PCT/HLLCompiler.pir​:481)
called from Sub 'parrot;PCT​::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir​:708)
called from Sub 'parrot;Perl6​::Compiler;main' pc 14567 (perl6.pir​:172)

$ ./perl6 -e 'my $a = {}; say $a.keys'
Method 'keys' not found for invocant of class 'Closure'
current instr.​: '_block11' pc 39 (EVAL_13​:19)
called from Sub 'parrot;PCT​::HLLCompiler;eval' pc 806
(src/PCT/HLLCompiler.pir​:481)
called from Sub 'parrot;PCT​::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir​:708)
called from Sub 'parrot;Perl6​::Compiler;main' pc 14567 (perl6.pir​:172)

@p6rt
Copy link
Author

p6rt commented Aug 7, 2008

From @jnthn

On Sun Jul 27 08​:27​:18 2008, masak wrote​:

From S06 <http://dev.perl.org/perl6/doc/design/syn/S06.html>&#8203;:

] {...} is always a block. However, if it is completely empty or
consists
] of a single list, the first element of which is either a hash or a
pair, it
] is executed immediately to compose a Hash object.
]
] [...]
]
] $obj = { 1=>2, 3=>4, 5=>6 }; # Anonymous hash

Rakudo is not up to spec on this point​:

$ ./perl6 -e 'my $a = { 1 => 2 }; say $a<1>'
get_pmc_keyed() not implemented in class 'Closure'

This and the other cases that are mentioned in the bit of spec you
quoted are implemented as of r30104.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Aug 7, 2008

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Aug 7, 2008
@p6rt
Copy link
Author

p6rt commented Aug 7, 2008

@jnthn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant