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

%h.delete() in right side of expression causes left side key missing #1750

Closed
p6rt opened this issue May 6, 2010 · 6 comments
Closed

%h.delete() in right side of expression causes left side key missing #1750

p6rt opened this issue May 6, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented May 6, 2010

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

Searchable as RT74946$

@p6rt
Copy link
Author

p6rt commented May 6, 2010

From @bbkr

perl6 -e 'my %h = {"a" => "b"}; %h{"a"} = %h.delete("a"); say %h.perl;'
{}

I'm not sure if it's a bug.

I expect right side to be evaluated and THEN assignment to performed.
So this assignment should behave as​:
%h{"a"} = "b"
And hash should not be empty.

bbkr

@p6rt
Copy link
Author

p6rt commented Oct 18, 2012

From @coke

On Thu May 06 07​:00​:43 2010, pawel.pabian@​implix.com wrote​:

perl6 -e 'my %h = {"a" => "b"}; %h{"a"} = %h.delete("a"); say %h.perl;'
{}

I'm not sure if it's a bug.

I expect right side to be evaluated and THEN assignment to performed.
So this assignment should behave as​:
%h{"a"} = "b"
And hash should not be empty.

bbkr

Several comments on #perl6 concur this is (still) a bug.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 18, 2012

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

@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

From @usev6

This works now (using current syntax -- e.g. :delete)​:

$ perl6-m -e 'my %h = a => "b"; %h{"a"} = %h{"a"} :delete; say %h.perl;'
("a" => "b").hash

I added a test to S32-hash/delete-adverb.t with the following commit​: Raku/roast@96c87780f7

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

From @usev6

This works now (using current syntax -- e.g. :delete)​:

$ perl6-m -e 'my %h = a => "b"; %h{"a"} = %h{"a"} :delete; say %h.perl;'
("a" => "b").hash

I added a test to S32-hash/delete-adverb.t with the following commit​: Raku/roast@96c87780f7

@p6rt p6rt closed this as completed Oct 13, 2014
@p6rt
Copy link
Author

p6rt commented Oct 13, 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