Please sign in to comment.
Fix roundtrippability of QuantHashes
- Set(|Hash) perlifies as Foo.new(...) - Bag(|Hash)|Mix(|Hash) perlifies as (...).Baggy (as coercer) - No longer specical case frequency/weight of 1 This seems inconsistent, but there is a reason for this. When a Setty is perlified, the objects of the Set need to be represented *without* any further interpretation. The fact that they occur in the .perl representation, indicates that that object needs to be put in the Setty *as is* when EVALled. This is different for Baggy's, as Baggy's have a frequency / weight attached to the object. That frequence / weight is expressed as a Pair with .perl. The weight / frequency information of Pairs is *only* interpreted when *coercing* to a Baggy. Before, when the frequency / weight of an object in a Baggy was 1, it would not show this in the perlification. This was wrong, as it introduced ambiguity between a Pair with weight 1, and an object with the same value as the key of such a Pair. So: (a => 42) => 1 would perlify the same as: a => 42 This is now fixed.
- Loading branch information...
Showing with 10 additions and 11 deletions.