mirror of
https://github.com/kanaka/mal.git
synced 2024-10-27 14:52:16 +03:00
22 lines
313 B
Fennel
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)))))
|