mirror of
https://github.com/kanaka/mal.git
synced 2024-08-17 09:40:21 +03:00
refactor SML to be more portable
This commit is contained in:
parent
5f4782d309
commit
3672361157
@ -1 +1 @@
|
||||
val _ = repl ()
|
||||
val _ = main ()
|
||||
|
@ -21,3 +21,5 @@ fun repl () =
|
||||
)
|
||||
| NONE => ()
|
||||
) end
|
||||
|
||||
fun main () = repl ()
|
||||
|
@ -23,3 +23,5 @@ fun repl () =
|
||||
)
|
||||
| NONE => ()
|
||||
) end
|
||||
|
||||
fun main () = repl ()
|
||||
|
@ -66,3 +66,5 @@ fun repl () =
|
||||
)
|
||||
| NONE => ()
|
||||
) end
|
||||
|
||||
fun main () = repl ()
|
||||
|
@ -62,9 +62,7 @@ val initEnv = ENV [] |> bind [
|
||||
| _ => raise NotApplicable "'/' requires arguments")
|
||||
]
|
||||
|
||||
fun repl () = repl' initEnv
|
||||
|
||||
and repl' e =
|
||||
fun repl e =
|
||||
let open TextIO
|
||||
in (
|
||||
print("user> ");
|
||||
@ -73,7 +71,9 @@ and repl' e =
|
||||
let val (e', s) = rep e line
|
||||
val _ = print(s ^ "\n")
|
||||
in
|
||||
repl' e'
|
||||
repl e'
|
||||
end
|
||||
| NONE => ()
|
||||
) end
|
||||
|
||||
fun main () = repl initEnv
|
||||
|
@ -51,9 +51,7 @@ fun rep e s =
|
||||
|
||||
val initEnv = ENV [] |> bind coreNs
|
||||
|
||||
fun repl () = repl' initEnv
|
||||
|
||||
and repl' e =
|
||||
fun repl e =
|
||||
let open TextIO
|
||||
in (
|
||||
print("user> ");
|
||||
@ -62,7 +60,9 @@ and repl' e =
|
||||
let val (e', s) = rep e line
|
||||
val _ = print(s ^ "\n")
|
||||
in
|
||||
repl' e'
|
||||
repl e'
|
||||
end
|
||||
| NONE => ()
|
||||
) end
|
||||
|
||||
fun main () = repl initEnv
|
||||
|
Loading…
Reference in New Issue
Block a user