diff --git a/lib/compiler.sx b/lib/compiler.sx index 392115cf..28a8a415 100644 --- a/lib/compiler.sx +++ b/lib/compiler.sx @@ -602,6 +602,7 @@ ((temp-slot (scope-define-local let-scope "__dict_src"))) (emit-op em 17) (emit-byte em temp-slot) + (emit-op em 5) (for-each (fn (k) @@ -623,7 +624,8 @@ (let ((slot (scope-define-local let-scope (if (= (type-of var-name) "symbol") (symbol-name var-name) var-name)))) (emit-op em 17) - (emit-byte em slot)))) + (emit-byte em slot) + (emit-op em 5)))) (keys pattern)) (compile-begin em body let-scope tail?))) (let @@ -641,7 +643,8 @@ (let ((slot (scope-define-local let-scope (symbol-name name)))) (emit-op em 17) - (emit-byte em slot)))) + (emit-byte em slot) + (emit-op em 5)))) bindings) (compile-begin em body let-scope tail?)))))) (define @@ -655,7 +658,7 @@ (let-scope (make-scope scope))) (dict-set! let-scope "next-slot" (get scope "next-slot")) (let - ((slots (map (fn (binding) (let ((name (if (= (type-of (first binding)) "symbol") (symbol-name (first binding)) (first binding)))) (let ((slot (scope-define-local let-scope name))) (emit-op em 2) (emit-op em 17) (emit-byte em slot) slot))) bindings))) + ((slots (map (fn (binding) (let ((name (if (= (type-of (first binding)) "symbol") (symbol-name (first binding)) (first binding)))) (let ((slot (scope-define-local let-scope name))) (emit-op em 2) (emit-op em 17) (emit-byte em slot) (emit-op em 5) slot))) bindings))) (for-each (fn (pair) @@ -663,7 +666,8 @@ ((binding (first pair)) (slot (nth pair 1))) (compile-expr em (nth binding 1) let-scope false) (emit-op em 17) - (emit-byte em slot))) + (emit-byte em slot) + (emit-op em 5))) (map (fn (i) (list (nth bindings i) (nth slots i))) (range 0 (len bindings)))))