savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
156 stars 12 forks source link

Add `Inspect.TraceData.Printer.Deterministic`. #432

Closed jemc closed 1 year ago

jemc commented 1 year ago

This is an alternative to Inspect.TraceData.Printer (the usual printer used by Inspect[...], which differs only in that it avoids printing recursion ids for objects and arrays directly.

Instead, it maps recursion ids onto sequential numbers, printing the first unique object/array as #1, the next as #2, etc.

This can be used for when the printed output needs to be used in a test suite, where the pointer-derived recursion ids would otherwise cause non-determinism in the output.