From 31ccba642d5a498274fecde92156ac1162bd1c17 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 5 Apr 2024 13:37:23 -0500 Subject: Add display and newline --- core.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core.lua') 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 return r[1] == r[2][1] end, -- equal? can be done in-library + ------- i/o + display = + function (r) + assert_arity(r, 1, 1) + io.write(tostring(r[1])) + end, + newline = + function (r) + assert_arity(r, 0, 0) + io.write("\n") + end, ------- numbers -- todo: assert all of these are numbers ["number?"] = -- cgit 1.4.1-21-gabe81