On Tue, Aug 21, 2012 at 6:08 AM, David Matthews <[email protected]> wrote: > On 20/08/2012 23:56, Phil Clayton wrote: >> >> I have to say, if find it surprising that compilers even allow >> Word.word to match the equivalent size Word<N>.word given the >> specification in the Basis Library >> <http://www.standardml.org/Basis/word.html> >> >> structure Word :> WORD >> where type word = word >> structure Word<N> :> WORD (* OPTIONAL *) >> >> which uses opaque signature matching and has no 'where type' clause for >> Word<N>. > > > This seems to be a bit of a mess as far as I can see. I don't understand > how to deal with the sentence that says: > If LargeWord is not the same as Word, then there must be a structure WordN > equal to LargeWord. > But LargeWord is required while WordN is optional. And what does "equal to" > mean for structures?
I've always understood "equal to" to simply mean that the "word" types are equal. It is perhaps wording leftover from SML'90 days, with structure sharing. As for "there must be a structure WordN equal to LargeWord", I've understood that to mean that an implementation should include a structure with the explicit width of LargeWord, such that LargeWord.word = WordN.word. Admittedly, I disagree with the Basis Library specification in this regard. I think it makes more sense for all of the INTEGER.int and all of the WORD.word types to be distinct; that is, "Word32.~ o LargeWord.~" should not type check, even if LargeWord.wordSize = 32. _______________________________________________ polyml mailing list [email protected] http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
