> The internal representation does only depend on the name of the
> constructor. This is described in one of Jacques Garrigues papers
> about Olabl. In particular you find, that variant tags `C00J10
> and `N60r0 have the same internal representation, so you can't
> use both of them in one program. (This was at least the case
> olabl 2.02, I haven't checked it with ocaml 2.99.)
Thanks for the explanation - now this really helps in understanding how the
internal representation looks like. I have just tried this with OCaml 2.99
- here the result:
# `C00J10 = `N60r0;;
In this program, variant constructors `C00J10 and `N60r0
have same hash value.
Interesting: so the internal representation of tags for polymorphic
variants is just the hash value of their names! Luckily, the system seems
to check whether two different names accidently have the same hash value...
(though it is probably very unlikely that two hash values of "normal" names
clash).
I guess that this is always safe since all the polymorphic variants appear
in the type, which makes it always unambiguous how to interpret values.
Best regards,
Markus Mottl
-- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl
This archive was generated by hypermail 2b29 : Tue Jan 11 2000 - 18:35:39 MET