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
|