[MLton] should Date.{fromString,scan} allow space instead of zero?

Daniel C. Wang danwang@CS.Princeton.EDU
Mon, 06 Sep 2004 21:41:01 -0400


Is there any reason not to have a  ref cell in some MLton specific structure 
that lets users choose between the restrictive and liberal mode? For 
portability nuts, it be nice to be able to test your code against the most 
restrictive reading of the Basis spec. I'd suggest there be one flag that 
controls liberal and restrictive mode for every useful feature that MLton 
supports but also deviates from the percise letter of the spec.

Stephen Weeks wrote:

> Does anyone have any thoughts on how we should handle the fact that
> the Basis Library spec requires the day to contain two digits (the
> first digit can not be a space) for the purposes of of
> Date.{fromString,scan}?  To be concrete, the spec says that
> 
>   Fri Jul 05 14:25:16 1996
> 
> should be accepted but that
> 
>   Fri Jul  5 14:25:16 1996
> 
> should not.
> 
> The current release of MLton (20040227) accepts both, but I recently
> changed it to follow the spec.  I am now having second thoughts -- as
> suggested by Peter Sestoft on the basis library discussion list, many
> programs generate dates with the space, so it seems better to be
> permissive when parsing a date to accept the space.
> 
> If we deviate, I could add a comment to the basis library section of
> the user guide.
>