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

27 lines
303 B
Crystal
Raw Normal View History

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