From 5dd23a44f332aadf60ccce3b7a63bf3871c170a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Wed, 24 Apr 2013 22:52:43 +0100 Subject: [PATCH] Define (SETF %JS-VREF) --- ecmalisp.lisp | 9 +++++++++ 1 file changed, 9 insertions(+) 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. ;;; -- 1.7.10.4