From d9870a8616d095f46819ff6478d2ecc5d714fadc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 5 Apr 2024 21:26:32 -0500 Subject: Add dump and run into circular dependencies --- core.lua | 13 +++++++++++++ repl.lua | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core.lua b/core.lua index f6d4e08..fd78997 100644 --- a/core.lua +++ b/core.lua @@ -4,6 +4,8 @@ local m = {} local type = require "type" local isa, null = type.isa, type.null local math = math +local dump = require("dump").dump +-- local load = require("repl").load -- circular dependency :< local util = require "util" local assert_arity = util.assert_arity @@ -43,6 +45,17 @@ m.env = { -- all functions here take R, which is the list of arguments assert_arity(r, 0, 0) io.write("\n") end, + dump = + function (r) + assert_arity(r, 1, 1) + return dump(r[1]) + end, + --[[ load = -- circular dependency :< + function (r) + assert_arity(r, 1, 1) + load(r[1]) + end, + --]] ------- numbers -- todo: assert all of these are numbers ["number?"] = diff --git a/repl.lua b/repl.lua index 86bc0af..c4a6546 100644 --- a/repl.lua +++ b/repl.lua @@ -41,7 +41,6 @@ function m.read_eval (filename, interactive) io.write(lam) io.output():setvbuf("line") else - io.output(io.stdout) -- hmmm io.output():setvbuf("no") end repeat -- cgit 1.4.1-21-gabe81