diff options
Diffstat (limited to 'core.lua')
-rw-r--r-- | core.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core.lua b/core.lua index 7891f3a..9563904 100644 --- a/core.lua +++ b/core.lua | |||
@@ -18,7 +18,22 @@ local function fold (kons, knil, r) | |||
18 | end | 18 | end |
19 | 19 | ||
20 | m.env = { -- all functions here take R, which is the list of arguments | 20 | m.env = { -- all functions here take R, which is the list of arguments |
21 | ------- equivalence | ||
22 | ["eqv?"] = | ||
23 | function (r) | ||
24 | assert_arity(r, 2, 2) | ||
25 | return r[1] == r[2][1] | ||
26 | end, | ||
27 | ["eq?"] = | ||
28 | function (r) | ||
29 | assert_arity(r, 2, 2) | ||
30 | -- from how i understand the Scheme spec, it's okay to | ||
31 | -- make `eqv?' and `eq?' the same. | ||
32 | return r[1] == r[2][1] | ||
33 | end, | ||
34 | -- equal? can be done in-library | ||
21 | ------- numbers | 35 | ------- numbers |
36 | -- todo: assert all of these are numbers | ||
22 | ["number?"] = | 37 | ["number?"] = |
23 | function (r) | 38 | function (r) |
24 | assert_arity(r, 1, 1) | 39 | assert_arity(r, 1, 1) |