From: Tim Vaughan Date: Sun, 29 Oct 2017 20:23:43 +0000 (+0100) Subject: Fixed another define-var bug. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=722badbcc9d3453b18df83c95a935c095a23d4a6;p=scheme.forth.jl.git Fixed another define-var bug. --- diff --git a/src/scheme.4th b/src/scheme.4th index ebbf159..68c3b67 100644 --- 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 2over 2over ( val frame var frame var ) + 2rot 2swap 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 ;