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

Capture.perl flattens out elements it shouldn't #2825

Closed
p6rt opened this issue Jul 12, 2012 · 4 comments
Closed

Capture.perl flattens out elements it shouldn't #2825

p6rt opened this issue Jul 12, 2012 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jul 12, 2012

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

Searchable as RT114100$

@p6rt
Copy link
Author

p6rt commented Jul 12, 2012

From @moritz

< moritz> r​: sub f(|$everything) { say $everything.perl }; my %h = :a,
:b, :!c; f(%h)
<+p6eval> rakudo 499cc6​: OUTPUT«Capture.new( list => ("a" => Bool​::True,
"b" => Bool​::True, "c" => Bool​::False).list, hash => EnumMap.new())␤»

< moritz> hm, that looks wrong. I'd exepcted it to retain the hash
< moritz> r​: sub f(|$everything) { say $everything[0].WHAT }; my %h =
:a, :b; f(%h)
<+p6eval> rakudo 499cc6​: OUTPUT«Hash()␤»
< moritz> ok, it does work
< moritz> it's just .perl that flattens it

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

From @jnthn

On Thu Jul 12 00​:38​:34 2012, moritz wrote​:

< moritz> r​: sub f(|$everything) { say $everything.perl }; my %h = :a,
:b, :!c; f(%h)
<+p6eval> rakudo 499cc6​: OUTPUT«Capture.new( list => ("a" => Bool​::True,
"b" => Bool​::True, "c" => Bool​::False).list, hash => EnumMap.new())␤»

< moritz> hm, that looks wrong. I'd exepcted it to retain the hash
< moritz> r​: sub f(|$everything) { say $everything[0].WHAT }; my %h =
:a, :b; f(%h)
<+p6eval> rakudo 499cc6​: OUTPUT«Hash()␤»
< moritz> ok, it does work
< moritz> it's just .perl that flattens it

Fixed, and added a test in S02-types/capture.t.

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

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

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

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

@p6rt p6rt closed this as completed Apr 28, 2015
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