The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated README.
[scheme.forth.jl.git]
/
scheme.4th
diff --git
a/scheme.4th
b/scheme.4th
index
b2efe17
..
0a237da
100644
(file)
--- a/
scheme.4th
+++ b/
scheme.4th
@@
-1412,24
+1412,36
@@
include scheme-primitives.4th
swap -
;
swap -
;
-: load ( addr n -- )
+: load ( addr n --
finalResult
)
open-input-file
empty-parse-str
open-input-file
empty-parse-str
+ ok-symbol ( port res )
+
begin
begin
- 2
dup read-port
+ 2
over read-port ( port res obj )
2dup EOF character-type objeq? if
2dup EOF character-type objeq? if
- 2drop close-port
+ 2drop
2swap
close-port
exit
then
exit
then
- global-env obj@ eval
- 2drop
+ 2swap 2drop ( port obj )
+
+ global-env obj@ eval ( port res )
again
;
again
;
+:noname ( args -- finalResult )
+ 2dup 1 ensure-arg-count
+ car string-type ensure-arg-type
+
+ drop pair-type
+ pad charlist>cstr
+ pad swap load
+; make-primitive load
+
\ }}}
\ ---- REPL ----
\ }}}
\ ---- REPL ----
@@
-1457,9
+1469,6
@@
include scheme-primitives.4th
again
;
again
;
-: test s" fact.scm" ;
-test load
-
forth definitions
\ vim:fdm=marker
forth definitions
\ vim:fdm=marker