1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
mal/crystal/step0_repl.cr

27 lines
309 B
Crystal
Raw Normal View History

2015-05-01 20:09:52 +03:00
#! /usr/bin/env crystal run
require "./readline"
# Note:
# Employed downcase names because Crystal prohibits uppercase names for methods
def read(x)
x
end
def eval(x)
x
end
def print(x)
x
end
def rep(x)
read(eval(print(x)))
end
2015-05-04 06:12:24 +03:00
while line = my_readline("user> ")
2015-05-01 20:09:52 +03:00
puts rep(line)
end