1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-26 22:28:26 +03:00
mal/impls/sml/step0_repl.sml
2021-05-02 17:35:40 -05:00

26 lines
400 B
Standard ML

fun read s: string =
s
fun eval s: string =
s
fun print s: string =
s
fun rep s: string =
(print o eval o read) s
fun repl () =
let open TextIO
in (
print("user> ");
case inputLine(stdIn) of
SOME(line) => (
print(rep(line) ^ "\n");
repl ()
)
| NONE => ()
) end
fun main () = repl ()