mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
27 lines
309 B
Crystal
Executable File
27 lines
309 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 = my_readline("user> ")
|
|
puts rep(line)
|
|
end
|