diff options
Diffstat (limited to 'load.lua')
-rw-r--r-- | load.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/load.lua b/load.lua index f798712..7f14207 100644 --- a/load.lua +++ b/load.lua | |||
@@ -3,7 +3,6 @@ | |||
3 | local m = {} | 3 | local m = {} |
4 | local core = require("core") | 4 | local core = require("core") |
5 | local eval = require("eval") | 5 | local eval = require("eval") |
6 | local port = require("port") | ||
7 | local read = require("read") | 6 | local read = require("read") |
8 | local type = require("type") | 7 | local type = require("type") |
9 | 8 | ||
@@ -23,7 +22,7 @@ end | |||
23 | 22 | ||
24 | function m.load (filename, interactive) | 23 | function m.load (filename, interactive) |
25 | -- interactive = { out = file/handle, prompt = string, } | 24 | -- interactive = { out = file/handle, prompt = string, } |
26 | local inport = port.input_port(filename) | 25 | local inport = type.input_port(filename) |
27 | if interactive then | 26 | if interactive then |
28 | io.output(interactive.out) | 27 | io.output(interactive.out) |
29 | io.output():setvbuf("line") | 28 | io.output():setvbuf("line") |
@@ -39,7 +38,7 @@ function m.load (filename, interactive) | |||
39 | local read_ok, form = xpcall( | 38 | local read_ok, form = xpcall( |
40 | function () return read.read(inport) end, | 39 | function () return read.read(inport) end, |
41 | handle_error) | 40 | handle_error) |
42 | if form == port.eof then break end | 41 | if form == type.eof then break end |
43 | if not read_ok then | 42 | if not read_ok then |
44 | io.stderr:write("error (read): ", form, "\n") | 43 | io.stderr:write("error (read): ", form, "\n") |
45 | -- when interactive, errors should not be fatal, but | 44 | -- when interactive, errors should not be fatal, but |
@@ -61,7 +60,7 @@ function m.load (filename, interactive) | |||
61 | if interactive then schemeprint(value) end | 60 | if interactive then schemeprint(value) end |
62 | end | 61 | end |
63 | end | 62 | end |
64 | until value == port.eof -- loop | 63 | until value == type.eof -- loop |
65 | end | 64 | end |
66 | 65 | ||
67 | -------- | 66 | -------- |