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:
b8da9ef
)
Fixed another define-var bug.
author
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 29 Oct 2017 20:23:43 +0000
(21:23 +0100)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 29 Oct 2017 20:23:43 +0000
(21:23 +0100)
src/scheme.4th
patch
|
blob
|
history
diff --git
a/src/scheme.4th
b/src/scheme.4th
index
ebbf159
..
68c3b67
100644
(file)
--- a/
src/scheme.4th
+++ b/
src/scheme.4th
@@
-497,15
+497,16
@@
hide var
: define-var ( var val env -- )
first-frame ( var val frame )
- 2rot 2
over 2over ( val frame var frame var
)
+ 2rot 2
swap 2over 2over ( val var frame var frame
)
get-vals-frame nil? if
- 2drop ( val frame var )
- -2rot add-binding
+ 2drop
+ -2rot 2swap 2rot
+ add-binding
else
- ( val
frame var
vals )
+ ( val
var frame
vals )
2swap 2drop 2swap 2drop
- cons
+ set-car!
then
;