-
-
Notifications
You must be signed in to change notification settings - Fork 11
Notes on The Standard ML Basis Library
The type unit should be an alias for {}, not an opaque type.
The document does not specify the handling of the signed zeroes. LunarML tries to honor the sign of zero. i.e.
min (0.0, ~0.0) = min (~0.0, 0.0) = ~0.0
max (0.0, ~0.0) = max (~0.0, 0.0) = 0.0
The condition on man should be "1.0 <= |man| * radix < radix".
The document does not explicitly say what realRound should do in the case of a tie.
LunarML breaks tie by choosing the nearest even integer (like round does).
The document says
If the absolute value of i is larger than
maxFinite, then the appropriate infinity is returned.
but it should be something like "If the absolute value of i is equal to or larger than maxFinite + 0.5 ulp (in the case of the current rounding mode is TO_NEAREST), then ...".
I mean, the program
val maxFinite = IntInf.<< (0x1fffffffffffff, 0w1023 - 0w52);
print (Real.fmt (StringCvt.SCI (SOME 17)) (Real.fromLargeInt (maxFinite + 1)) ^ "\n");should print a finite value.
The negative sign on the exponent part should be allowed:
[~]?[0-9].[0-9]+?E[~]?[0-9]+
^^^^
The documentation does not say if the hexadecimal characters in \uxxxx should be uppercase or lowercase. LunarML chooses uppercase.
toString does not say what to do if the character code cannot be expressed by four hexadecimal digits (i.e. ord x >= 0x10000).
LunarML plans use \U<eight hex digits> format.
Should accept \U<eight hex digits>.
toString does not say what to do if the character code cannot be expressed by three octal digits (i.e. ord x >= 512).
LunarML plans to use \u<four hex digits> or \U<eight hex digits> format.
Should accept \u<four hex digits> and \U<eight hex digits> if the value satisfies the condition (x >= 0xA0 andalso not (x >= 0xD800 andalso x <= 0xDFFF)) orelse x = 0x24 orelse x = 0x40 orelse x = 0x60 (see C's spec).
The type of scan should be
val scan : (Char.char, 'a) StringCvt.reader -> (string, 'a) StringCvt.reader
(* ^^^^^^^^^ *)rather than
val scan : (char, 'a) StringCvt.reader -> (string, 'a) StringCvt.reader
(* ^^^^ *)The type realisations
structure Text :> TEXT
...
where type CharVector.vector = CharVector.vector
...
structure WideText :> TEXT
...
where type CharVector.vector = WideCharVector.vector
...
are redundant because CharVector.vector = String.string.
It is not clear how WideTextIO is different than TextIO.
OS.Path should support UNC paths (like \\foo\bar\baz) on Windows.