Skip to content

Commit

Permalink
Interactive REPL.
Browse files Browse the repository at this point in the history
  • Loading branch information
middlefeng committed Mar 20, 2015
1 parent 610613e commit b3ded4e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lisp_cmd.lua
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@


local quote = require "quote"
local eval = require "eval_cont"
local lisp = require "lisp"


local cmd
local env = eval.Environment.initEnv()

local function func_noop() end

repeat
io.write("> ")
cmd = io.read("l")

if cmd ~= "exit" then
local bottom_cont = eval.ContinuationBottom:new(func_noop)
local s_exp = quote.quote(cmd)
local value = eval.eval_begin(s_exp, env, bottom_cont)
print(value)
end

until cmd == "exit"

0 comments on commit b3ded4e

Please sign in to comment.