Permalink
Browse files

Interactive REPL.

  • Loading branch information...
1 parent 610613e commit b3ded4e86f38cfb86370d3061fdb0708e3f3e9c6 @middlefeng committed Mar 20, 2015
Showing with 25 additions and 0 deletions.
  1. +25 −0 lisp_cmd.lua
View
@@ -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.