mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
26 lines
283 B
Ruby
26 lines
283 B
Ruby
require "readline"
|
|
|
|
# read
|
|
def READ(str)
|
|
return str
|
|
end
|
|
|
|
# eval
|
|
def EVAL(ast, env)
|
|
return ast
|
|
end
|
|
|
|
# print
|
|
def PRINT(exp)
|
|
return exp
|
|
end
|
|
|
|
# repl
|
|
def REP(str)
|
|
return PRINT(EVAL(READ(str), {}))
|
|
end
|
|
|
|
while line = Readline.readline("user> ", true)
|
|
puts REP(line)
|
|
end
|