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

Null PMC access when doing hash indexing on a hash ref in Rakudo #1929

Closed
p6rt opened this issue Jul 11, 2010 · 10 comments
Closed

Null PMC access when doing hash indexing on a hash ref in Rakudo #1929

p6rt opened this issue Jul 11, 2010 · 10 comments

Comments

@p6rt
Copy link

p6rt commented Jul 11, 2010

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

Searchable as RT76462$

@p6rt
Copy link
Author

p6rt commented Jul 11, 2010

From @masak

<cosimo> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say $h_ref.{'a'}
<p6eval> rakudo 7579f7​: OUTPUT«Null PMC access in type() [...]
<cosimo> mmh* masak submits rakudobug
<masak> rakudo​: say (\my %h)<a>
<p6eval> rakudo 7579f7​: OUTPUT«Null PMC access in type() [...]

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 9, 2011

From @coke

On Sun Jul 11 06​:30​:54 2010, masak wrote​:

<cosimo> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say $h_ref.{'a'}
<p6eval> rakudo 7579f7​: OUTPUT�Null PMC access in type() [...]
<cosimo> mmh* masak submits rakudobug
<masak> rakudo​: say (\my %h)<a>
<p6eval> rakudo 7579f7​: OUTPUT�Null PMC access in type() [...]

the NPA is gone, but I'm not sure this is better​:

11​:58 < [Coke]> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say $h_ref.{'a'}
11​:59 <+p6eval> rakudo f6eb61​: OUTPUT«exists_keyed_str() not implemented in
  class 'Mu'␤ in method at_key at src/gen/CORE.setting​:3249␤ in
  method postcircumfix​:<{ }> at src/gen/CORE.setting​:1011␤ in
  block <anon> at /tmp/J7FOLR_f3K​:1␤ in <anon> at
  /tmp/J7FOLR_f3K​:1␤»
11​:59 < [Coke]> rakudo​: say (\my %h)<a>
11​:59 <+p6eval> rakudo f6eb61​: OUTPUT«exists_keyed_str() not implemented in
  class 'Mu'␤ in method at_key at src/gen/CORE.setting​:3249␤ in
  method postcircumfix​:<{ }> at src/gen/CORE.setting​:1011␤ in
  block <anon> at /tmp/5rDn0XQCzx​:1␤ in <anon> at
  /tmp/5rDn0XQCzx​:1␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

new behavior and commentary​:

12​:36 < diakopter> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say
$h_ref.{'a'}
12​:36 <+p6eval> rakudo e2d876​: OUTPUT«Any()␤»
12​:37 < jnthn> r​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say $h_ref.perl
12​:37 <+p6eval> rakudo e2d876​: OUTPUT«Capture.new( list => ("a" => 1,
"b" => 2).list, hash
  => EnumMap.new())␤»
12​:37 < jnthn> Ah, it's somehow gone and stuck it in the capture as if
it was a positional
  arg.
12​:38 < jnthn> It...prolly shouldn't do that.
12​:38 < diakopter> if I had access to RT I could add that as a comment
to the ticket
12​:39 < diakopter> well, the behavior has changed on it since it was
last commented on
12​:40 < sorear> jnthn​: errm, rakudo's behavior does not look like
'positional arg'
12​:40 < sorear> n​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say $h_ref.perl
12​:40 <+p6eval> niecza v18​: OUTPUT«\({"a" => 1, "b" => 2}.hash)␤»
12​:40 < jnthn> sorear​: ah, hmm, it's list contexted it too
12​:41 < jnthn> sorear​: I'm guessing it should populate the hash portion
of the capture.
12​:41 < jnthn> oh, maybe not though.
12​:41 * jnthn should read the spec and stopp guessing :)

@p6rt
Copy link
Author

p6rt commented Nov 16, 2012

From @coke

On Sun Oct 09 08​:59​:47 2011, coke wrote​:

On Sun Jul 11 06​:30​:54 2010, masak wrote​:

<cosimo> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say
$h_ref.{'a'}
<p6eval> rakudo 7579f7​: OUTPUT�Null PMC access in type() [...]
<cosimo> mmh* masak submits rakudobug
<masak> rakudo​: say (\my %h)<a>
<p6eval> rakudo 7579f7​: OUTPUT�Null PMC access in type() [...]

the NPA is gone, but I'm not sure this is better​:

11​:58 < [Coke]> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say
$h_ref.{'a'}
11​:59 <+p6eval> rakudo f6eb61​: OUTPUT«exists_keyed_str() not
implemented in
class 'Mu'␤ in method at_key at
src/gen/CORE.setting​:3249␤ in
method postcircumfix​:<{ }> at
src/gen/CORE.setting​:1011␤ in
block <anon> at /tmp/J7FOLR_f3K​:1␤ in <anon> at
/tmp/J7FOLR_f3K​:1␤»
11​:59 < [Coke]> rakudo​: say (\my %h)<a>
11​:59 <+p6eval> rakudo f6eb61​: OUTPUT«exists_keyed_str() not
implemented in
class 'Mu'␤ in method at_key at
src/gen/CORE.setting​:3249␤ in
method postcircumfix​:<{ }> at
src/gen/CORE.setting​:1011␤ in
block <anon> at /tmp/5rDn0XQCzx​:1␤ in <anon> at
/tmp/5rDn0XQCzx​:1␤»

Behavior has changed again -

23​:45 <[Coke]> rakudo​: my %h=('a'=>1,'b'=>2); my $h_ref=\%h; say $h_ref.{'a'}
23​:45 <p6eval> rakudo a41a48​: OUTPUT«Any()␤»
23​:49 <[Coke]> rakudo​: say (\my %h)<a>
23​:49 <p6eval> rakudo a41a48​: OUTPUT«Any()␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 29, 2014

From @usev6

Since the Null PMC access is gone, I'm inclined to close this ticket (after adding a test or two).

$ perl6 -e 'my %h=("a"=>1,"b"=>2); my $h_ref=\%h; say $h_ref.{"a"}'
(Any)

WRT the following command I wonder what output is expected currently. It looks as if the content of %h is put in the "list" part of the Capture​:

$ perl6 -e 'my %h=(a=>1,b=>2); my $ref = \%h; say $ref.perl; say $ref[0].perl'
Capture.new(list => ("a" => 1, "b" => 2,))
("b" => 2, "a" => 1).hash

I'm not sure if that's the right thing. If that's not the case, IMHO a new ticket should be created for that problem, considering

$ perl6 -e 'say (\(a=>1,b=>2)).perl'
Capture.new(hash => {"b" => 2, "a" => 1})

$ perl6 -e 'say (\%(a=>1,b=>2)).perl'
Capture.new(list => ("a" => 1, "b" => 2,))

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 29, 2014

From @usev6

Since the Null PMC access is gone, I'm inclined to close this ticket (after adding a test or two).

$ perl6 -e 'my %h=("a"=>1,"b"=>2); my $h_ref=\%h; say $h_ref.{"a"}'
(Any)

WRT the following command I wonder what output is expected currently. It looks as if the content of %h is put in the "list" part of the Capture​:

$ perl6 -e 'my %h=(a=>1,b=>2); my $ref = \%h; say $ref.perl; say $ref[0].perl'
Capture.new(list => ("a" => 1, "b" => 2,))
("b" => 2, "a" => 1).hash

I'm not sure if that's the right thing. If that's not the case, IMHO a new ticket should be created for that problem, considering

$ perl6 -e 'say (\(a=>1,b=>2)).perl'
Capture.new(hash => {"b" => 2, "a" => 1})

$ perl6 -e 'say (\%(a=>1,b=>2)).perl'
Capture.new(list => ("a" => 1, "b" => 2,))

@p6rt
Copy link
Author

p6rt commented Oct 30, 2014

From @usev6

On Wed Oct 29 05​:41​:15 2014, bartolin@​gmx.de wrote​:

Since the Null PMC access is gone, I'm inclined to close this ticket
(after adding a test or two).

I added the tests to S02-literals/autoref.t with commit Raku/roast@bca6134945.

$ perl6 -e 'my %h=("a"=>1,"b"=>2); my $h_ref=\%h; say $h_ref.{"a"}'
(Any)

WRT the following command I wonder what output is expected currently.
It looks as if the content of %h is put in the "list" part of the
Capture​:

$ perl6 -e 'my %h=(a=>1,b=>2); my $ref = \%h; say $ref.perl; say
$ref[0].perl'
Capture.new(list => ("a" => 1, "b" => 2,))
("b" => 2, "a" => 1).hash

I'm not sure if that's the right thing. If that's not the case, IMHO a
new ticket should be created for that problem, considering

$ perl6 -e 'say (\(a=>1,b=>2)).perl'
Capture.new(hash => {"b" => 2, "a" => 1})

$ perl6 -e 'say (\%(a=>1,b=>2)).perl'
Capture.new(list => ("a" => 1, "b" => 2,))

I'm closing this ticket now.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 30, 2014

From @usev6

On Wed Oct 29 05​:41​:15 2014, bartolin@​gmx.de wrote​:

Since the Null PMC access is gone, I'm inclined to close this ticket
(after adding a test or two).

I added the tests to S02-literals/autoref.t with commit Raku/roast@bca6134945.

$ perl6 -e 'my %h=("a"=>1,"b"=>2); my $h_ref=\%h; say $h_ref.{"a"}'
(Any)

WRT the following command I wonder what output is expected currently.
It looks as if the content of %h is put in the "list" part of the
Capture​:

$ perl6 -e 'my %h=(a=>1,b=>2); my $ref = \%h; say $ref.perl; say
$ref[0].perl'
Capture.new(list => ("a" => 1, "b" => 2,))
("b" => 2, "a" => 1).hash

I'm not sure if that's the right thing. If that's not the case, IMHO a
new ticket should be created for that problem, considering

$ perl6 -e 'say (\(a=>1,b=>2)).perl'
Capture.new(hash => {"b" => 2, "a" => 1})

$ perl6 -e 'say (\%(a=>1,b=>2)).perl'
Capture.new(list => ("a" => 1, "b" => 2,))

I'm closing this ticket now.

@p6rt
Copy link
Author

p6rt commented Oct 30, 2014

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

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

No branches or pull requests

1 participant