Ah, you are right that it might not be human-friendly.
I don't want to rely on the order, but for (file) versioning it is quite valuable. (or rather changing the order can easily make versioning quite worthless).
I can manually sort it, but it creates a lot of mess:
(NeoJSONWriter on: stream)
prettyPrint: true;
for: Something
do: [ :mapping | mapping mapInstVars: (mapping identifier instVarNames \ #(unwanted)) sorted ];
for: Otherthing
do: [ :mapping | mapping mapInstVars: mapping identifier instVarNames sorted ];
for: Point
do: [ :mapping | mapping mapInstVars: mapping identifier instVarNames sorted ];
nextPut: anObject.
I'd much rather have the following:
(NeoJSONWriter on: stream)
prettyPrint: true;
sorted: true;
for: Something
do: [ :mapping | mapping mapInstVars: mapping identifier instVarNames \ #(unwanted) ];
mapInstVarsFor: Otherthing;
mapInstVarsFor: Point;
nextPut: anObject.
or more fine-grained, although the above is imo nicer:
(NeoJSONWriter on: stream)
prettyPrint: true;
for: Something
do: [ :mapping | mapping mapInstVars: (mapping identifier instVarNames \ #(unwanted)) sorted ];
mapInstVarsFor: Otherthing sorted: true;
mapInstVarsFor: Point sorted: true;
nextPut: anObject.
(or mapSortedInstVarsFor: or something)..
Peter