about summary refs log tree commit diff stats
path: root/eval.lua
diff options
context:
space:
mode:
authorCase Duckworth2024-02-22 00:29:23 -0600
committerCase Duckworth2024-02-22 00:29:23 -0600
commit34d94104686fdb6e3bc2573315291770cab37cf3 (patch)
tree847181cf70c590ea1735586295583fa138102bc0 /eval.lua
parentAdd global and types libraries (diff)
downloadlam-34d94104686fdb6e3bc2573315291770cab37cf3.tar.gz
lam-34d94104686fdb6e3bc2573315291770cab37cf3.zip
Change types to lowercase; add todos
Diffstat (limited to 'eval.lua')
-rw-r--r--eval.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/eval.lua b/eval.lua index cdf4612..185268f 100644 --- a/eval.lua +++ b/eval.lua
@@ -10,7 +10,7 @@ local types = require("types")
10if not table.unpack then table.unpack = unpack end 10if not table.unpack then table.unpack = unpack end
11 11
12local function Env(inner, outer) 12local function Env(inner, outer)
13 return setmetatable(inner, { __type = "Environment", __index = outer, }) 13 return setmetatable(inner, { __type = "environment", __index = outer, })
14end 14end
15 15
16local function Proc(params, body, env) 16local function Proc(params, body, env)
@@ -20,7 +20,7 @@ local function Proc(params, body, env)
20 env = env, 20 env = env,
21 } 21 }
22 local mt = { 22 local mt = {
23 __type = "Procedure", 23 __type = "procedure",
24 __call = 24 __call =
25 function (self, ...) 25 function (self, ...)
26 local inner = {} 26 local inner = {}
@@ -37,7 +37,7 @@ end
37 37
38function eval.eval (x, e) 38function eval.eval (x, e)
39 e = e or global 39 e = e or global
40 if types.lamtype(x) == "Symbol" then 40 if types.lamtype(x) == "symbol" then
41 return e[x] 41 return e[x]
42 elseif types.luatype(x) ~= "table" then 42 elseif types.luatype(x) ~= "table" then
43 return x 43 return x