next up previous contents
Next: Unsafe: UNSAFE Up: MLton extensions Previous: MLton.World   Contents

SMLofNJ: SML_OF_NJ

SMLofNJ implements a subset of the structure of the same name provided in Standard ML of New Jersey. It is included to make it easier to port programs between the two systems. The semantics of these functions may be different than in SML/NJ.

signature SML_OF_NJ =
   sig
      structure Cont:
         sig
            type 'a cont
            val callcc: ('a cont -> 'a) -> 'a
            val throw: 'a cont -> 'a -> 'b
         end
      structure SysInfo:
         sig
	    exception UNKNOWN
	    datatype os_kind = BEOS | MACOS | OS2 | UNIX | WIN32

	    val getHostArch: unit -> string
	    val getOSKind: unit -> os_kind
	    val getOSName: unit -> string
         end
      structure Internals:
         sig
            structure GC:
               sig
                  val messages: bool -> unit
               end             
         end

      val exnHistory: exn -> string list
      val exportFn: string * (string * string list -> OS.Process.status) -> unit
      val exportML: string -> bool
      val getCmdName: unit -> string
      val getArgs: unit -> string list
      val getAllArgs: unit -> string list
   end

structure Cont

implements continuations.

SysInfo.getHostArch ()

returns "X86".

SysInfo.getOSKind

returns UNIX.

SysInfo.getOSName ()

returns "Linux".

Internals.GC.messages b

the same as MLton.GC.messages b.

exnHistory

the same as MLton.Exn.history.

getCmdName ()

the same as CommandLine.name ().

getArgs ()

the same as CommandLine.arguments ().

getAllArgs ()

the same as getCmdName() :: getArgs().

exportFn f

save the state of the computation to a file that will apply f to the command-line arguments upon restart.

exportML f

save the state of the computation to file f and continue. Return true in the restarted computation and false in the continuing computation.


next up previous contents
Next: Unsafe: UNSAFE Up: MLton extensions Previous: MLton.World   Contents