Commit | Line | Data |
---|---|---|
85c1b0c0 | 1 | #! /usr/bin/env crystal run |
2 | ||
5185c56e | 3 | require "readline" |
85c1b0c0 | 4 | |
5 | # Note: | |
6 | # Employed downcase names because Crystal prohibits uppercase names for methods | |
7 | ||
8 | def read(x) | |
5185c56e | 9 | x |
85c1b0c0 | 10 | end |
11 | ||
12 | def eval(x) | |
5185c56e | 13 | x |
85c1b0c0 | 14 | end |
15 | ||
16 | def print(x) | |
5185c56e | 17 | x |
85c1b0c0 | 18 | end |
19 | ||
20 | def rep(x) | |
5185c56e | 21 | read(eval(print(x))) |
85c1b0c0 | 22 | end |
23 | ||
5185c56e OR |
24 | while line = Readline.readline("user> ") |
25 | puts rep(line) | |
85c1b0c0 | 26 | end |