From: David Vázquez Date: Wed, 24 Apr 2013 21:52:43 +0000 (+0100) Subject: Define (SETF %JS-VREF) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=5dd23a44f332aadf60ccce3b7a63bf3871c170a1;p=jscl.git Define (SETF %JS-VREF) --- diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 85ca88d..7b82d82 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -2065,6 +2065,15 @@ (define-compilation %js-vset (var val) (code "(" var " = " (ls-compile val) ")")) +(define-setf-expander %js-vref (var) + (let ((new-value (gensym))) + (unless (stringp var) + (error "a string was expected")) + (values nil + (list var) + (list new-value) + `(%js-vset ,var ,new-value) + `(%js-vref ,var)))) ;;; Backquote implementation. ;;;