[MLton-devel] Word32.toLargeIntX discrepancy between MLton and SMLNJ
Matthew Fluet
Matthew Fluet <fluet@CS.Cornell.EDU>
Sat, 13 Jul 2002 11:56:45 -0400 (EDT)
> MLton is correct and SML/NJ is incorrect, because both MLton and
> SML/NJ provide IntInf, and the specification says
>
> > The type FixedInt.int is the largest fixed precision integer
> > supported, while the type LargeInt.int is the largest integer
> > supported. If an implementation provides the IntInf structure, then
> > the type LargeInt.intis be the same as IntInf.int.
While this is true, I'd say it's really a "bug" with the Basis Library.
Nikos' problematic example
> > fun bug x = (5 : Int32.int) = Word32.toLargeIntX x
seems to be legal in an implementation that does not provide an IntInf
structure, but becomes illegal when compiled under a basis that does
provide an IntInf structure. The fact that the type equivalnce of
LargeInt.int and IntInf.int (or Int32.int) is exported makes porting
between implementations more difficult than it should be. Really, I'd
argue that the above should not type check in any implementation while
fun good x = (5 : LargeInt.int) = Word32.toLargeIntX x
should type check in all implementations.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel