diff options
-rw-r--r-- | eval.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/eval.lua b/eval.lua index 4a4ad0e..e13fb97 100644 --- a/eval.lua +++ b/eval.lua | |||
@@ -49,6 +49,7 @@ function m.procedure (params, body, env) | |||
49 | end | 49 | end |
50 | 50 | ||
51 | local specials = { | 51 | local specials = { |
52 | m.specials = { | ||
52 | -- each of these takes R (a list of args) and E (an environment) | 53 | -- each of these takes R (a list of args) and E (an environment) |
53 | quote = | 54 | quote = |
54 | function (r, e) return r[1] end, | 55 | function (r, e) return r[1] end, |
@@ -70,8 +71,8 @@ local specials = { | |||
70 | -- TODO: include, import, define-syntax, ... | 71 | -- TODO: include, import, define-syntax, ... |
71 | } | 72 | } |
72 | -- Aliases | 73 | -- Aliases |
73 | specials.lam = specials.lambda | 74 | m.specials.lam = m.specials.lambda |
74 | specials.def = specials.define | 75 | m.specials.def = m.specials.define |
75 | 76 | ||
76 | function m.eval (x, env) | 77 | function m.eval (x, env) |
77 | local env = env or core.env | 78 | local env = env or core.env |
@@ -81,8 +82,8 @@ function m.eval (x, env) | |||
81 | return x | 82 | return x |
82 | else | 83 | else |
83 | local op, args = x[1], x[2] | 84 | local op, args = x[1], x[2] |
84 | if specials[op] then | 85 | if m.specials[op] then |
85 | return specials[op](args, env) | 86 | return m.specials[op](args, env) |
86 | else -- procedure call | 87 | else -- procedure call |
87 | local fn = m.eval(op, env) | 88 | local fn = m.eval(op, env) |
88 | local params = {} | 89 | local params = {} |