Permalink
Browse files

Fix Bag.Str and KeyBag.Str to conform to TimToady's suggestions.

  • Loading branch information...
1 parent 1cee55b commit ede8b6d8f2f15f45d50a55989ab2cfe83a836d25 @colomon colomon committed Mar 27, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/CORE.setting
View
@@ -2185,7 +2185,7 @@ class Bag does Associative does Baggy {
submethod BUILD (%!elems) { }
- submethod Str(Any:D $ : --> Str) { "bag({ self.pairs>>.perl.join(', ') })" }
+ submethod Str(Any:D $ : --> Str) { %!elems.pairs.map({ $_.key xx $_.value }).flat.join(" ") }
submethod gist(Any:D $ : --> Str) { "bag({ self.pairs>>.gist.join(', ') })" }
submethod perl(Any:D $ : --> Str) { 'Bag.new(' ~ %!elems.perl ~ ')' }
@@ -2257,7 +2257,7 @@ class KeyBag does Associative does Baggy {
submethod BUILD (%!elems) { }
- submethod Str(Any:D $ : --> Str) { "keybag({ self.pairs>>.perl.join(', ') })" }
+ submethod Str(Any:D $ : --> Str) { %!elems.pairs.map({ $_.key xx $_.value }).flat.join(" ") }
submethod gist(Any:D $ : --> Str) { "keybag({ self.pairs>>.gist.join(', ') })" }
submethod perl(Any:D $ : --> Str) { 'KeyBag.new(' ~ %!elems.perl ~ ')' }

0 comments on commit ede8b6d

Please sign in to comment.