The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cf26585
)
Load now returns result of last expression.
author
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 25 Oct 2016 03:57:32 +0000
(16:57 +1300)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 25 Oct 2016 03:57:32 +0000
(16:57 +1300)
scheme.4th
patch
|
blob
|
history
diff --git
a/scheme.4th
b/scheme.4th
index
b2efe17
..
7626be8
100644
(file)
--- a/
scheme.4th
+++ b/
scheme.4th
@@
-1412,21
+1412,24
@@
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
;
@@
-1458,7
+1461,7
@@
include scheme-primitives.4th
;
: test s" fact.scm" ;
;
: test s" fact.scm" ;
-test load
+test load
2drop
forth definitions
forth definitions