[MLton] Is this really legal to allow?

Matthew Fluet matthew.fluet at gmail.com
Sat Oct 24 11:45:41 PDT 2009


I don't know that it is illegal.  Most SML compilers expose the fact
that LargeInt == IntInf, though, arguably, the Basis Library asserts
that they are both opaquely sealed.

In any case, I don't think the fix is easy in MLton.  String constants
are overloaded and handled by the compiler, and so must elaborate to a
type known by the compiler, which only knows about the primitive types
'char' and 'vector'.  There isn't an easy way to get the abstract
String.string type (as would arise if we didn't include enough
sharing/where-type constraints in the signature match that exports the
basis library) "into" the compiler as the type for string constant
elaboration.

On Thu, Oct 22, 2009 at 5:41 PM, Henry Cejtin
<henry.cejtin at sbcglobal.net> wrote:
> I   see   that   MLton   (both  the 20070826 version and the current SVN
> version) consider the following to be legal:
>
>    val x: char vector = "Is this legal?"
>
> I know, of course, that in MLton CharVector.vector is just the same   as
> char vector, but is it legal to make that visible?
>
> The   argument   against   this   is  that  the resulting code certainly
> won't be compiled by most ML compilers.
>
> _______________________________________________
> MLton mailing list
> MLton at mlton.org
> http://mlton.org/mailman/listinfo/mlton
>



More information about the MLton mailing list