HCoop
/
jackhill
/
mal.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Merge pull request #216 from hinrik/add_perl6_impl
[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
if
#
arg
>
0
and
arg
[
1
] ==
"--raw"
then
22
readline
.
raw
=
true
23
end
24
25
while true do
26
line
=
readline
.
readline
(
"user> "
)
27
if not
line
then break end
28
print
(
rep
(
line
))
29
end