mirror of
https://github.com/kanaka/mal.git
synced 2024-10-26 22:28:26 +03:00
26 lines
400 B
Standard ML
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 ()
|