Common Lisp: Add documentation
[jackhill/mal.git] / logo / step1_read_print.lg
CommitLineData
4eb88ef2
DM
1load "../logo/readline.lg
2load "../logo/reader.lg
3load "../logo/printer.lg
4
5to _read :str
6output read_str :str
7end
8
9to _eval :ast :env
10output :ast
11end
12
13to _print :exp
14output pr_str :exp "true
15end
16
17to rep :str
18output _print _eval _read :str []
19end
20
21to repl
22localmake "running "true
23while [:running] [
24 localmake "line readline word "user> :space_char
25 ifelse :line=[] [
26 print "
27 make "running "false
28 ] [
29 if not emptyp :line [
30 catch "error [print rep :line]
31 localmake "exception error
32 if not emptyp :exception [
33 (print "Error: first butfirst :exception)
34 ]
35 ]
36 ]
37]
38end
39
40repl
41bye