[MLton] Word<N>

Matthew Fluet fluet@cs.cornell.edu
Tue, 22 Mar 2005 09:36:31 -0500 (EST)


> > I hope I am not missing something obvious but why is N > 1.  Why not implement
> > Word1? 
> 
> I don't see any reason to rule out word1 (or int1, for that matter).  In
> fact, it appears that the compiler handles word1; the primitive tycon
> word1 is provided in the primitive environment and the rest of the
> compiler is all nicely abstracted on word sizes.
> 
> Unfortunately, there seems to be a bug in the elaborator, because it does
> not like
> 
> val t : Word1.word = 0wx1

This was a bug on my part; I forgot a sharing constraint that made
Word1.word equivalent to the primitive word1 known by the compiler.

So, it is a very small change to the Basis Library implementation to make 
Word1 available.  It is a very small change to the compiler itself and the 
Basis Library implementation to make Int1 available.  I've checked in such 
changes to CVS.