about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--core.lua13
-rw-r--r--repl.lua1
2 files changed, 13 insertions, 1 deletions
diff --git a/core.lua b/core.lua index f6d4e08..fd78997 100644 --- a/core.lua +++ b/core.lua
@@ -4,6 +4,8 @@ local m = {}
4local type = require "type" 4local type = require "type"
5local isa, null = type.isa, type.null 5local isa, null = type.isa, type.null
6local math = math 6local math = math
7local dump = require("dump").dump
8-- local load = require("repl").load -- circular dependency :<
7local util = require "util" 9local util = require "util"
8local assert_arity = util.assert_arity 10local assert_arity = util.assert_arity
9 11
@@ -43,6 +45,17 @@ m.env = { -- all functions here take R, which is the list of arguments
43 assert_arity(r, 0, 0) 45 assert_arity(r, 0, 0)
44 io.write("\n") 46 io.write("\n")
45 end, 47 end,
48 dump =
49 function (r)
50 assert_arity(r, 1, 1)
51 return dump(r[1])
52 end,
53 --[[ load = -- circular dependency :<
54 function (r)
55 assert_arity(r, 1, 1)
56 load(r[1])
57 end,
58 --]]
46 ------- numbers 59 ------- numbers
47 -- todo: assert all of these are numbers 60 -- todo: assert all of these are numbers
48 ["number?"] = 61 ["number?"] =
diff --git a/repl.lua b/repl.lua index 86bc0af..c4a6546 100644 --- a/repl.lua +++ b/repl.lua
@@ -41,7 +41,6 @@ function m.read_eval (filename, interactive)
41 io.write(lam) 41 io.write(lam)
42 io.output():setvbuf("line") 42 io.output():setvbuf("line")
43 else 43 else
44 io.output(io.stdout) -- hmmm
45 io.output():setvbuf("no") 44 io.output():setvbuf("no")
46 end 45 end
47 repeat 46 repeat