X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/36a305a723c63fd345be65c536c52fe9765c14be..6b3770fb9dd180abbda32383eba5e961e76d7504:/lisp/emacs-lisp/gv.el diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 7858c183e4..3dd021f9e7 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -194,7 +194,7 @@ well for simple place forms. Assignments of VAL to (NAME ARGS...) are expanded by binding the argument forms (VAL ARGS...) according to ARGLIST, then executing BODY, which must return a Lisp form that does the assignment. -The first arg in ARLIST (the one that receives VAL) receives an expression +The first arg in ARGLIST (the one that receives VAL) receives an expression which can do arbitrary things, whereas the other arguments are all guaranteed to be pure and copyable. Example use: (gv-define-setter aref (v a i) `(aset ,a ,i ,v))" @@ -358,7 +358,8 @@ The return value is the last VAL in the list. (put 'if 'gv-expander (lambda (do test then &rest else) - (if (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy))) + (if (or (not lexical-binding) ;The other code requires lexical-binding. + (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy)))) ;; This duplicates the `do' code, which is a problem if that ;; code is large, but otherwise results in more efficient code. `(if ,test ,(gv-get then do) @@ -376,7 +377,8 @@ The return value is the last VAL in the list. (put 'cond 'gv-expander (lambda (do &rest branches) - (if (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy))) + (if (or (not lexical-binding) ;The other code requires lexical-binding. + (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy)))) ;; This duplicates the `do' code, which is a problem if that ;; code is large, but otherwise results in more efficient code. `(cond