Ignore:
Timestamp:
10/11/08 21:40:21 (14 years ago)
Author:
ehuelsmann
Message:

Fix PSETQ.7: PSETQ on a symbol-macrolet bound symbol should behave like psetf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/macros.lisp

    r11340 r11344  
    110110          (push (list (car d) (car v)) let-list)))))
    111111
    112 (defmacro psetq (&rest args)
     112(defmacro psetq (&environment env &rest args)
    113113  (do ((l args (cddr l))
    114114       (forms nil)
    115115       (bindings nil))
    116116    ((endp l) (list* 'let* (reverse bindings) (reverse (cons nil forms))))
    117     (let ((sym (gensym)))
    118       (push (list sym (cadr l)) bindings)
    119       (push (list 'setq (car l) sym) forms))))
     117    (if (and (symbolp (car l))
     118             (eq (car l) (macroexpand-1 (car l) env)))
     119        (let ((sym (gensym)))
     120          (push (list sym (cadr l)) bindings)
     121          (push (list 'setq (car l) sym) forms))
     122        (multiple-value-bind
     123              (dummies vals newval setter getter)
     124            (get-setf-expansion (macroexpand-1 (car l) env) env)
     125          (declare (ignore getter))
     126          (do ((d dummies (cdr d))
     127               (v vals (cdr v)))
     128              ((null d))
     129            (push (list (car d) (car v)) bindings))
     130          (push (list (car newval) (cadr l)) bindings)
     131          (push setter forms)))))
    120132
    121133(defmacro time (form)
Note: See TracChangeset for help on using the changeset viewer.