mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
15 lines
311 B
Nim
15 lines
311 B
Nim
import rdstdin, types, reader, printer
|
|
|
|
proc read(str: string): MalType = str.read_str
|
|
|
|
proc eval(ast: MalType): MalType = ast
|
|
|
|
proc print(exp: MalType): string = exp.pr_str
|
|
|
|
while true:
|
|
try:
|
|
let line = readLineFromStdin("user> ")
|
|
echo line.read.eval.print
|
|
except:
|
|
echo getCurrentExceptionMsg()
|