mal
mal copied to clipboard
pprint properly prints hash-maps
Current implementation of pprint is not compatible with implementations using languages that do not guarantee that keys on a hash-map keep ordering (e.g. Go language).
This PR corrects this.
With previous code, the effect was that some keys appear duplicated and others do not appear at all when printing a hash-map with pprint.
This fix extracts the keys list only once, so hash-map keys order indetermination is not an issue.
Validated with Go language.