local open Fnlib in (* Integer ranges *) val maxint_byte = 255 and minint_byte = 0 and maxint_short = 32767 and minint_short = (~32768) ; (* The default name for executable bytecode files. *) #ifdef unix val default_exec_name = "a.out"; #endif #ifdef macintosh val default_exec_name = "Mosml.out"; #endif #ifdef msdos val default_exec_name = "mosmlout.exe"; #endif (* Prompts *) val toplevel_input_prompt = "- "; val toplevel_output_prompt = "> "; val toplevel_output_cont_prompt = " "; val toplevel_error_prompt = "! "; val batch_output_prompt = "> "; val batch_output_cont_prompt = " "; val batch_error_prompt = "! "; (* Run-time values *) val realTag = 254; val stringTag = 253; val abstractTag = 252; val noScanTag = 252; val closureTag = 251; val refTag = 250; val maxBlockTag = refTag-1; (* Unit sets *) val reservedUnitNames = ["General", "Top", "Meta"]; val pervasiveOpenedUnits = ["General"]; val fulllib = ["Option", "List", "ListPair", "Strbase", "Char", "String", "StringCvt", "TextIO", "BasicIO", "Vector", "Help", "Array", "Misc", "Substring", "Bool", "Int", "Real", "Math", "Word", "Word8", "Word8Vector", "Word8Array", "Byte", "BinIO", "CharVector", "CharArray", "Time", "Timer", "Date", "Path", "OS", "FileSys", "Process", "Mosml", "PP", "CommandLine"] val preloadedUnitSets = [ ("none", []), ("default", ["Option", "List", "Strbase", "Char", "String", "StringCvt", "TextIO", "BasicIO", "Vector", "Help", "Array", "Misc"]), ("full", fulllib), ("sml90", ["Option", "List", "Strbase", "Char", "String", "StringCvt", "TextIO", "BasicIO", "Vector", "Help", "Array", "Misc", "SML90"]), ("nj93", ["Option", "List", "Strbase", "Char", "String", "StringCvt", "TextIO", "BasicIO", "NJ93", "Vector", "Help", "Array", "Misc"]) ]; val preopenedPreloadedUnitSets = [ ("none", []), ("default", ["Misc", "Help"]), ("full", ["Misc", "Help"]), ("sml90", ["Misc", "SML90", "Help"]), ("nj93", ["Misc", "NJ93", "Help"]), ("parsing", ["Misc", "Help"]) ]; #ifdef msdos val kosherUnitNames = [ ("Basicio", "BasicIO"), ("Binio", "BinIO"), ("Chararra", "CharArray"), ("Charvect", "CharVector"), ("Commandl", "CommandLine"), ("Filesys", "FileSys"), ("Listpair", "ListPair"), ("Nj93", "NJ93"), ("Os", "OS"), ("Pp", "PP"), ("Sml90", "SML90"), ("Stringcv", "StringCvt"), ("Substrin", "Substring"), ("Textio", "TextIO"), ("Word8arr", "Word8Array"), ("Word8vec", "Word8Vector") ]; local open CharVector; infix 9 sub; in fun normalizedFileName s = Fnlib.stringToLower s; fun normalizedUnitName s = let val len = size s val () = if len = 0 then raise SysErr("Empty unit name", NONE) else () val len0 = if len>8 then 8 else len val s0 = tabulate(len0, fn i => (case i of 0 => Char.toUpper | _ => Char.toLower) (s sub i)) in lookup s0 kosherUnitNames handle Subscript => s0 end; end; #else fun normalizedFileName s = s; fun normalizedUnitName s = s; #endif (* To translate escape sequences *) val char_for_backslash = fn #ifdef macintosh (* *) #"n" => #"\013" (* *) | #"r" => #"\010" #else (* *) #"n" => #"\010" (* *) | #"r" => #"\013" #endif (* *) | #"a" => #"\007" (* *) | #"b" => #"\008" (* *) | #"t" => #"\009" (* *) | #"v" => #"\011" (* *) | #"f" => #"\012" (* *) | c => c ; end;