From: Matthew F. <fl...@CS...> - 2002-07-23 15:50:04
|
John and SML implementers, Here are a loose collection of notes I've taken while starting to update the MLton implementation of the SML Basis Library to the latest version. They span quite a range: errata and typos, signature constraint concerns, and some design questions. Thus far, I've looked at the structures that had been grouped under the headings General, Text, Integer, Reals, Lists, and Arrays and Vectors (i.e., excluding IO, System, and Posix) in the "old" web specification. A few high level comments: * As an organizational principal, I liked the grouping of modules into larger collections used in the "old" web specification better than the long alphabetical list. * I'm quite happy to see opaque signature matches for most structures. In particular, I think it will help avoid porting problems between implementations that provide different INTEGER structures, especially when LargeInt = Int in one implementation and LargeInt = IntInf in another. Required and optional components, Top-level: * A number of structures have an opaque signature match in overview.html, but not in the corresponding structure specific page: General, Bool, Option, List, ListPair, IntInf, Array, ArraySlice, Vector, VectorSlice. * Word8Array2 is listed as required in overview.html, but its signature, MONO_ARRAY2, is not required. Furthermore, Word8Array2 is marked optional in mono-array2.html. I don't quite see a rationale for Word8Array2 being required. * With the addition of val ~ : word -> word to the WORD signature, presumably ~ should be overloaded at num, rather than at intreal. Reals: * In pack-float.html, the where type clauses are incorrect: structure PackRealBig :> PACK_REAL where type PackRealBig.real = Real.real should be structure PackRealBig :> PACK_REAL where type real = Real.real * Likewise, in most places, references to basic types are unqualifed, so perhaps the where clause should read where type real = real for the PackRealBig and PackRealLittle structures. Arrays and Vectors: * In vector-slice.html, the description of subslice references |arr| when it should reference |sl|. * In {[mono-]array[-slice],[mono-]vector[-slice]}.html, the description of findi references appi when it should reference findi. * In mono-array-slice.html, structure CharArraySlice has the clause where type array = CharVector.vector which should be where type array = CharArray.array. * In mono-{vector[-slice],array[-slice],array2}.html, there are Word<N> structures but no (default word) Word structures. * In mono-vector.html, structure CharVector has the clause where type elem = Char.char while the other monomorphic vectors of basic types reference the unqualified type; i.e. structure BoolVector has the clause where type elem = bool. * There are no "See also"'s into MONO_VECTOR_SLICE or MONO_ARRAY_SLICE from MONO_VECTOR or MONO_ARRAY. * A long discussion about types defined in [MONO_]{ARRAY,VECTOR}[_SLICE] signatures; deferred to a separate email. Really nit-picky: * Ordering of comparison functions (>, >=, etc.) and unary negation are different within INTEGER and WORD. * Ordering of functions in CHAR seems awkward. * Ordering of full, slice, subslice different in ARRAY_SLICE and VECTOR_SLICE. * Ordering of foldi/fold and modifi/modify different in ARRAY2 and MONO_ARRAY2. Top-level and opaque signatures: * I think it would be useful to see the entire top-level of required structures written out with their respective signature constraints. For example, in the description of the Math structure, the spec reads: "The top-level structure Math provides these functions for the default real type Real.real." Because the top-level Math structure has an opaque signature match (in overview.html), then the sentence above implies that there ought to be the constraint where type real = real (or Real.real). Granted, none of the other structures in overview.html have where clauses, and most type constraints are documented in the structure specific pages, but the constraint on the top-level Math.real slipped my mind when I first looked at it. -Matthew |