HCoop
/
jackhill
/
mal.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Nim: step8
[jackhill/mal.git]
/
lua
/
step0_repl.lua
1
#!/
usr
/
bin
/
env lua
2
3
local
readline
=
require
(
'readline'
)
4
5
function
READ
(
str
)
6
return
str
7
end
8
9
function
EVAL
(
ast
,
any
)
10
return
ast
11
end
12
13
function
PRINT
(
exp
)
14
return
exp
15
end
16
17
function
rep
(
str
)
18
return
PRINT
(
EVAL
(
READ
(
str
),
""
))
19
end
20
21
while true do
22
line
=
readline
.
readline
(
"user> "
)
23
if not
line
then break end
24
print
(
rep
(
line
))
25
end