1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 12:47:45 +03:00
mal/ruby/step0_repl.rb
2014-04-10 20:34:29 -05:00

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