1(* 2 Title: Rebuild the basis library: Word 3 Copyright David C.J. Matthews 2016 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License version 2.1 as published by the Free Software Foundation. 8 9 This library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with this library; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17*) 18 19(* Word, LargeWord etc. *) 20useBasis "WordSignature.sml"; (* This depends on Word, Int, etc but the dependencies on Word don't affect this. *) 21 22structure Word: WORD = 23struct 24 open Word 25 val wordSize = FixedInt.toLarge wordSize 26 val fromInt = fromLargeInt 27 and toInt = toLargeInt 28 and toIntX = toLargeIntX 29end; 30 31structure LargeWord: WORD = 32struct 33 open LargeWord 34 val wordSize = FixedInt.toLarge wordSize 35 val fromInt = fromLargeInt 36 and toInt = toLargeInt 37 and toIntX = toLargeIntX 38end; 39 40structure SysWord: WORD = 41struct 42 open SysWord 43 val wordSize = FixedInt.toLarge wordSize 44 val fromInt = fromLargeInt 45 and toInt = toLargeInt 46 and toIntX = toLargeIntX 47end; 48 49 50structure Word32: WORD = 51struct 52 open Word32 53 val wordSize = FixedInt.toLarge wordSize 54 val fromInt = fromLargeInt 55 and toInt = toLargeInt 56 and toIntX = toLargeIntX 57end; 58 59structure Word8: WORD = 60struct 61 open Word8 62 val wordSize = FixedInt.toLarge wordSize 63 val fromInt = fromLargeInt 64 and toInt = toLargeInt 65 and toIntX = toLargeIntX 66end; 67 68val () = if LargeWord.wordSize = 64 then useLocal "Word64.sml" else (); 69 70