about summary refs log tree commit diff stats
path: root/eval.lua
diff options
context:
space:
mode:
authorCase Duckworth2024-04-15 22:00:37 -0500
committerCase Duckworth2024-04-15 22:00:37 -0500
commit6c49847668e01d45cf56ec2b2e4fbf312957ee3d (patch)
treea4f85b67e41c7c03d0fa6830c187020d74157f65 /eval.lua
parentRefactor type.character (diff)
downloadlam-6c49847668e01d45cf56ec2b2e4fbf312957ee3d.tar.gz
lam-6c49847668e01d45cf56ec2b2e4fbf312957ee3d.zip
Change names and hoist eval
read is unimplemented and load is buggy
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 4b8f782..342624f 100644 --- a/eval.lua +++ b/eval.lua
@@ -6,7 +6,7 @@ local assert_arity = type.assert_arity
6local util = require("util") 6local util = require("util")
7local error = util.error 7local error = util.error
8 8
9m.special_forms = { 9m.primitives = {
10 quote = 10 quote =
11 function (r, _) 11 function (r, _)
12 assert_arity(r,1,1) 12 assert_arity(r,1,1)
@@ -89,8 +89,8 @@ function m.eval (x, env)
89 return x 89 return x
90 else 90 else
91 local op, args = x[1], x[2] 91 local op, args = x[1], x[2]
92 if m.special_forms[op] then 92 if m.primitives[op] then
93 return m.special_forms[op](args, env) 93 return m.primitives[op](args, env)
94 else -- procedure application 94 else -- procedure application
95 local fn = m.eval(op, env) 95 local fn = m.eval(op, env)
96 local params = {} 96 local params = {}