mirror of
https://github.com/kanaka/mal.git
synced 2024-09-20 18:18:51 +03:00
09dce03504
The `io/run` script will run the io interpreter on a step file given in the `$STEP` environment variable. It'll swallow the first 25 bytes printed by the interpreter because they are a startup message about the Io Regex module (and can't be suppressed in a normal way).
19 lines
298 B
Io
19 lines
298 B
Io
Regex
|
|
|
|
READ := method(str, str)
|
|
|
|
EVAL := method(ast, env, ast)
|
|
|
|
PRINT := method(exp, exp)
|
|
|
|
RE := method(str, EVAL(READ(str), nil))
|
|
|
|
REP := method(str, PRINT(RE(str)))
|
|
|
|
loop(
|
|
line := MalReadline readLine("user> ")
|
|
if(line isNil, break)
|
|
if(line isEmpty, continue)
|
|
REP(line) println
|
|
)
|