1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 12:47:45 +03:00
mal/process/step1_read_print.txt
2015-01-29 23:40:10 -06:00

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)