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

27 lines
303 B
Crystal
Executable File

#! /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
while line = Readline.readline("user> ")
puts rep(line)
end