[MLton-user] IntInf.fromString and leading spaces

Matthew Fluet mtf at cs.rit.edu
Tue Sep 15 18:30:39 PDT 2009


On Tue, 15 Sep 2009, David Hansel wrote:
> We have come across one minor issue:  The IntInf.fromString
> function does not appear to handle leading spaces well.  Other
> fromString functions have no problem with leading spaces.
>
> For example, (IntInf.fromString " 1") evaluates to NONE
> whereas (Int.fromString " 1") evalutates to SOME 1.

Yes, there was a bug in IntInf.scan (and IntInf.fromString) spaces were 
only accepted if the stream had an explicit sign character.  Thanks for 
the report.

The bug is now fixed by SVN r7227 
(http://mlton.org/cgi-bin/viewsvn.cgi?view=rev&rev=7227).  Since the patch 
only affects the Basis Library, you can apply it to an existing install of 
MLton (/usr/lib/mlton/sml/basis/integer/int-inf.sml). There is no need to 
rebuild the compiler.



More information about the MLton-user mailing list