From 81be7fec584156d80020bcdab896a64d758baa87 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 13 Apr 2024 18:01:12 -0500 Subject: Move port.lua to type.lua Ports are types --- load.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'load.lua') diff --git a/load.lua b/load.lua index f798712..7f14207 100644 --- a/load.lua +++ b/load.lua @@ -3,7 +3,6 @@ local m = {} local core = require("core") local eval = require("eval") -local port = require("port") local read = require("read") local type = require("type") @@ -23,7 +22,7 @@ end function m.load (filename, interactive) -- interactive = { out = file/handle, prompt = string, } - local inport = port.input_port(filename) + local inport = type.input_port(filename) if interactive then io.output(interactive.out) io.output():setvbuf("line") @@ -39,7 +38,7 @@ function m.load (filename, interactive) local read_ok, form = xpcall( function () return read.read(inport) end, handle_error) - if form == port.eof then break end + if form == type.eof then break end if not read_ok then io.stderr:write("error (read): ", form, "\n") -- when interactive, errors should not be fatal, but @@ -61,7 +60,7 @@ function m.load (filename, interactive) if interactive then schemeprint(value) end end end - until value == port.eof -- loop + until value == type.eof -- loop end -------- -- cgit 1.4.1-21-gabe81