1
1
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:
Fabian 2021-03-29 14:06:10 +02:00 committed by Joel Martin
parent 5f4782d309
commit 3672361157
6 changed files with 15 additions and 9 deletions

View File

@ -1 +1 @@
val _ = repl ()
val _ = main ()

View File

@ -21,3 +21,5 @@ fun repl () =
)
| NONE => ()
) end
fun main () = repl ()

View File

@ -23,3 +23,5 @@ fun repl () =
)
| NONE => ()
) end
fun main () = repl ()

View File

@ -66,3 +66,5 @@ fun repl () =
)
| NONE => ()
) end
fun main () = repl ()

View File

@ -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

View File

@ -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