IntInf.fromString and leading spaces

View: New views
2 Messages — Rating Filter:   Alert me  

IntInf.fromString and leading spaces

by David Hansel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

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.

We are currently using
MLton MLTONVERSION (built Tue Feb 03 16:33:30 2009 on orange)

Best regards,

David

--
  ----------------------------------------------------------
  David Hansel
  Reactive Systems, Inc.
  http://www.reactive-systems.com/
  ----------------------------------------------------------



_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user

Re: IntInf.fromString and leading spaces

by Matthew Fluet-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

_______________________________________________
MLton-user mailing list
MLton-user@...
http://mlton.org/mailman/listinfo/mlton-user