1 (* Copyright (C
) 1999-2006, 2008 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
3 * Copyright (C
) 1997-2000 NEC Research Institute
.
5 * MLton is released under a BSD
-style license
.
6 * See the file MLton
-LICENSE for details
.
9 structure SMLofNJ
: SML_OF_NJ
=
13 structure C
= MLton
.Cont
17 val isolate
= C
.isolate
18 fun throw k v
= C
.throw (k
, v
)
24 datatype os_kind
= BEOS | MACOS | OS2 | UNIX | WIN32
27 MLton
.Platform
.Arch
.toString MLton
.Platform
.Arch
.host
31 open MLton
.Platform
.OS
47 fun getOSName () = MLton
.Platform
.OS
.toString MLton
.Platform
.OS
.host
50 val getCmdName
= CommandLine
.name
51 val getArgs
= CommandLine
.arguments
53 fun getAllArgs () = getCmdName () :: getArgs ()
55 val exnHistory
= MLton
.Exn
.history
57 fun exportFn (file
: string, f
) =
59 open MLton
.World OS
.Process
61 case save (file ^
".mlton") of
62 Original
=> exit success
63 | Clone
=> exit (f (getCmdName (), getArgs ()) handle _
=> failure
)
66 fun exportML (f
: string): bool =
70 case save (f ^
".mlton") of