Michael Norrish wrote:
How can I prettyprint a reference value so that I get some idea from
looking at the output whether two such values are the same or not?

I would suggest using PolyML.showSize. This displays the actual contents of an arbitrary data structure in hex and includes the addresses of the cells. You need to be aware that any garbage collection between two calls to showSize may result in the addresses changing.

RunCall.unsafeCast is just that: extremely unsafe, and assumes that you know the representations of the types before and after the cast are compatible. Casting a ref to an int will cause the address of the ref cell to be treated as the address of a piece of memory containing the long precision representation of an integer and will either give nonsense or could segfault.

David
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to