[MLton] getting String.fromString to return NONE

Stephen Weeks sweeks@sweeks.com
Sun, 30 Jul 2006 18:16:26 -0700


> > Michael, here are your examples, with today's implementations.
> >
> >                spec   Hamlet  ML Kit  MLton  Mosml            SML/NJ
> >                -----  ------  ------  -----  -----            -------
...
> > 9. "\n"        ""     NONE    "\n"    ""     "\n"             NONE
...
> My interpretation of the above quote is that the spec agrees with Hamlet and
> NJ on example 9. Because if "prefix" were meant to include the empty one,
> then the whole sentence wouldn't make any sense, and NONE would indeed never
> be returned.

I agree.  Given the problems with the spec and the lack of resolution,
I've moved the MLton implementation to match the proposed spec I sent
out.  I've made a note to myself to document this on our wiki.

> > and that tabs and newlines would not be allowed, since they are not
> > allowed in SML strings (some implementations don't even agree on that:
> > Hamlet and the ML Kit allow tabs, and Hamlet allows newlines).
> 
> Mh, looking at the above table, you probably mean Mosml, not Hamlet. :-)

Actually, I was just plain wrong.  Neither Hamlet nor Moscow ML allow
tabs or newlines in string constants in source code.  The only one
that differs from other implementations is the ML Kit, which allows
tabs.  (Note that I am not talking about the table above, which refers
to what each implementation's basis library does -- I am talking about
what the implementation's lexer does on string constants.)