aboutsummaryrefslogtreecommitdiff
path: root/lua/step0_repl.lua
blob: 24584d2e82b18c4a758ce168805d21768cb5eba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env lua

local readline = require('readline')

function READ(str)
    return str
end

function EVAL(ast, any)
    return ast
end

function PRINT(exp)
    return exp
end

function rep(str)
    return PRINT(EVAL(READ(str),""))
end

while true do
    line = readline.readline("user> ")
    if not line then break end
    print(rep(line))
end