1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/ruby/step0_repl.rb

27 lines
294 B
Ruby
Raw Normal View History

2015-02-28 02:36:27 +03:00
require_relative "mal_readline"
2014-04-11 05:34:29 +04:00
# 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
# repl loop
while line = _readline("user> ")
2014-04-11 05:34:29 +04:00
puts REP(line)
end