On 04/12/2012 07:07 PM, Leo P White wrote:
Just like exceptions, they are represented as constructors whose first
field points to an address that is allocated by the extension definition
to represent that extension. They have a special tag value so that
structural equality knows to compare the first fields by address. Note
that this is exactly what is required to fix the bug with structural
equality on exceptions (4765).
Do we really need a new special tag? Why not use Object_tag and
represent slots as blocks of size 2 (constructor name + unique integer
as the second field)? This would have the following consequences (which
are the expected ones):
- The generic equality function compares the unique ids.
- The generic hash function returns the unique id.
- The generic unmarshaling function allocates a fresh id when
umarshaling such a block.
Alain
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs