[MLton] SML/NJ deviation: rebinding ref

Vesa Karvonen vesa.karvonen at cs.helsinki.fi
Mon Aug 14 22:35:54 PDT 2006


Quoting Stephen Weeks <sweeks at sweeks.com>:
> > SML/NJ (at least v110.59), allows rebindind ref
[...]
> > This seems to be disallowed on page 9 of the Definition.
> 
> Indeed.  Pleaase add that one.

Done.  I was curious and tried the other illegal rebindings (true, false,
nil, and ::) listed on page 9 of the Definition.  They are all allowed
in SML/NJ (at least in v110.59 without further configuration).  So,
SML/NJ is consistent in this respect.

BTW, is there a good reason to prevent rebinding those identifiers?  A
good reason would be one that would introduce unsoundness into the language
or seriously complicate implementation, but, with my limited understanding
of compiling SML, I can't see why something like that would have to happen.

-Vesa Karvonen



More information about the MLton mailing list