Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Normalize Baggy.gist to make consistent with future Mixy.gist
  • Loading branch information
lizmat committed Oct 3, 2013
1 parent 6f84eb5 commit 147c1e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/Baggy.pm
Expand Up @@ -54,17 +54,17 @@ my role Baggy does QuantHash {
}

multi method Str(Baggy:D $ : --> Str) {
~ %!elems.values.map({ .key xx .value });
~ %!elems.values.map( {
.value == 1 ?? .key.gist !! "{.key.gist}({.value})"
} );
}
multi method gist(Baggy:D $ : --> Str) {
my $name := self.^name;
( $name eq 'Bag' ?? 'bag' !! "$name.new" )
~ '('
~ %!elems.values.map( {
.value > 1 # rather arbitrarily
?? "{.key.gist}({.value})"
!! .key.gist xx .value
} ).join(', ')
.value == 1 ?? .key.gist !! "{.key.gist}({.value})"
} ).join(', ')
~ ')';
}
multi method perl(Baggy:D $ : --> Str) {
Expand Down

0 comments on commit 147c1e0

Please sign in to comment.