1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-27 14:52:16 +03:00
mal/impls/fennel/step0_repl.fnl
2021-04-23 01:46:44 +09:00

22 lines
313 B
Fennel

(fn READ [code-str]
code-str)
(fn EVAL [ast]
ast)
(fn PRINT [ast]
ast)
(fn rep [code-str]
(PRINT (EVAL (READ code-str))))
(var done false)
(while (not done)
(io.write "user> ")
(io.flush)
(let [input (io.read)]
(if (not input)
(set done true)
(print (rep input)))))