about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2024-04-05 13:37:23 -0500
committerCase Duckworth2024-04-05 13:37:23 -0500
commit31ccba642d5a498274fecde92156ac1162bd1c17 (patch)
treea3d845d921ff0bcda8ce5a60569af4ad84d9b238
parentCatch read errors (diff)
downloadlam-31ccba642d5a498274fecde92156ac1162bd1c17.tar.gz
lam-31ccba642d5a498274fecde92156ac1162bd1c17.zip
Add display and newline
-rw-r--r--core.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/core.lua b/core.lua index 9563904..f6d4e08 100644 --- a/core.lua +++ b/core.lua
@@ -32,6 +32,17 @@ m.env = { -- all functions here take R, which is the list of arguments
32 return r[1] == r[2][1] 32 return r[1] == r[2][1]
33 end, 33 end,
34 -- equal? can be done in-library 34 -- equal? can be done in-library
35 ------- i/o
36 display =
37 function (r)
38 assert_arity(r, 1, 1)
39 io.write(tostring(r[1]))
40 end,
41 newline =
42 function (r)
43 assert_arity(r, 0, 0)
44 io.write("\n")
45 end,
35 ------- numbers 46 ------- numbers
36 -- todo: assert all of these are numbers 47 -- todo: assert all of these are numbers
37 ["number?"] = 48 ["number?"] =