mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
15 lines
315 B
Plaintext
15 lines
315 B
Plaintext
--- step1_read_print ----------------------------
|
|
import reader, printer
|
|
|
|
READ(str): return reader.read_str(str)
|
|
|
|
EVAL(ast,env): return ast
|
|
|
|
PRINT(exp): return printer.pr_str(exp)
|
|
|
|
rep(str): return PRINT(EVAL(READ(str),""))
|
|
|
|
main loop:
|
|
try: println(rep(readline("user> ")))
|
|
catch e: println("Error: ", e)
|