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
Hashes flatten lists #305
Comments
From @moritzRakudo r30946: 08:35 < masak> rakudo: .perl.say for {a => ["b", "c"]}.kv # I have a fun that should have been ["b", "c"] on the second line 08:38 <@moritz> rakudo: my %a = (a => [[3], [4,5]]); say %a<a>.perl the should have been [[3], [4,5]] It seems they are even stored flat: 08:56 <@moritz> rakudo: my %a = (a => [[3], [4,5]]); say %a.perl This is the bug that makes t/spec/S29-num/rounders.t so ugly (take a Moritz -- |
From @moritzMoritz Lenz (via RT) wrote:
Some more insight, found out by bacek and Tene on #parrot: $ ./perl6 -e '(a => [[1], [2]]).perl.say' So it seems that the flattening happens when assigning the hash to a %h Moritz -- |
From @pmichaudOn Wed, Sep 10, 2008 at 12:22:01PM +0200, Moritz Lenz wrote:
Now fixed in r30967. The problem is that the .kv method was $ ../../parrot perl6.pbc
Note how the hash correctly has an Int 3 but the list produced
This looks to me like the generic problem that Rakudo is having Thanks! Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @bacekPatrick R. Michaud wrote:
.values still stringifying values. Trivial patch attached. -- |
From @bacekmapping.patchdiff --git a/languages/perl6/src/classes/Mapping.pir b/languages/perl6/src/classes/Mapping.pir
index d83d980..abca0b1 100644
--- a/languages/perl6/src/classes/Mapping.pir
+++ b/languages/perl6/src/classes/Mapping.pir
@@ -136,8 +136,8 @@ Returns elements of hash as array of C<Pair(key, value)>
loop:
unless iter goto end
$S1 = shift iter
- $S1 = iter[$S1]
- push rv, $S1
+ $P1 = iter[$S1]
+ push rv, $P1
goto loop
end:
.return (rv)
|
From @pmichaudNow fixed in r32441. Here are the results: $ ./parrot perl6.pbc
Thanks! Pm |
1 similar comment
From @pmichaudNow fixed in r32441. Here are the results: $ ./parrot perl6.pbc
Thanks! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#58744 (status was 'resolved')
Searchable as RT58744$
The text was updated successfully, but these errors were encountered: