diff options
author | Case Duckworth | 2024-04-15 22:00:37 -0500 |
---|---|---|
committer | Case Duckworth | 2024-04-15 22:00:37 -0500 |
commit | 6c49847668e01d45cf56ec2b2e4fbf312957ee3d (patch) | |
tree | a4f85b67e41c7c03d0fa6830c187020d74157f65 /eval.lua | |
parent | Refactor type.character (diff) | |
download | lam-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.lua | 6 |
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 | |||
6 | local util = require("util") | 6 | local util = require("util") |
7 | local error = util.error | 7 | local error = util.error |
8 | 8 | ||
9 | m.special_forms = { | 9 | m.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 = {} |