Commit | Line | Data |
---|---|---|
b94acce6 | 1 | import rdstdin, types, reader, printer |
2 | ||
3 | proc read(str: string): MalType = str.read_str | |
4 | ||
5 | proc eval(ast: MalType): MalType = ast | |
6 | ||
7 | proc print(exp: MalType): string = exp.pr_str | |
8 | ||
9 | while true: | |
10 | try: | |
11 | let line = readLineFromStdin("user> ") | |
12 | echo line.read.eval.print | |
13 | except: | |
14 | echo getCurrentExceptionMsg() |