From 25289632b5546a09f6e5c23d32e20c5a4a9114a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Sat, 29 Jun 2013 19:17:14 +0200 Subject: [PATCH] LET --- src/compiler.lisp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index af7acb6..2da9fd2 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -695,20 +695,16 @@ (cvalues (mapcar #'ls-compile (mapcar #'second bindings))) (*environment* (extend-local-env (remove-if #'special-variable-p variables))) (dynamic-bindings)) - `(code "(function(" - ,@(interleave - (mapcar (lambda (x) - (if (special-variable-p x) - (let ((v (gvarname x))) - (push (cons x v) dynamic-bindings) - v) - (translate-variable x))) - variables) - ",") - "){" - ,(let ((body (ls-compile-block body t t))) - `(code ,(let-binding-wrapper dynamic-bindings body))) - "})(" ,@(interleave cvalues ",") ")"))) + `(call (function ,(mapcar (lambda (x) + (if (special-variable-p x) + (let ((v (gvarname x))) + (push (cons x v) dynamic-bindings) + (make-symbol v)) + (make-symbol (translate-variable x)))) + variables) + ,(let ((body (ls-compile-block body t t))) + `(code ,(let-binding-wrapper dynamic-bindings body)))) + ,@cvalues))) ;;; Return the code to initialize BINDING, and push it extending the -- 1.7.10.4