Changeset 11340


Ignore:
Timestamp:
10/11/08 16:15:53 (13 years ago)
Author:
ehuelsmann
Message:

Use environment for macroexpansion and get-setf-expander
instead of the null environment (which will never hold bindings).

File:
1 edited

Legend:

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

    r11297 r11340  
    6666
    6767;; Adapted from SBCL.
    68 (defmacro push (item place)
     68(defmacro push (&environment env item place)
    6969  (if (and (symbolp place)
    70      (eq place (macroexpand place)))
     70     (eq place (macroexpand place env)))
    7171      `(setq ,place (cons ,item ,place))
    7272      (multiple-value-bind (dummies vals newval setter getter)
    73         (get-setf-expansion place)
     73        (get-setf-expansion place env)
    7474        (let ((g (gensym)))
    7575          `(let* ((,g ,item)
     
    7979
    8080;; Adapted from SBCL.
    81 (defmacro pushnew (item place &rest keys)
     81(defmacro pushnew (&environment env item place &rest keys)
    8282  (if (and (symbolp place)
    83      (eq place (macroexpand place)))
     83     (eq place (macroexpand place env)))
    8484      `(setq ,place (adjoin ,item ,place ,@keys))
    8585      (multiple-value-bind (dummies vals newval setter getter)
    86         (get-setf-expansion place)
     86        (get-setf-expansion place env)
    8787        (let ((g (gensym)))
    8888          `(let* ((,g ,item)
     
    9292
    9393;; Adapted from SBCL.
    94 (defmacro pop (place)
     94(defmacro pop (&environment env place)
    9595  (if (and (symbolp place)
    96      (eq place (macroexpand place)))
     96     (eq place (macroexpand place env)))
    9797      `(prog1 (car ,place)
    9898        (setq ,place (cdr ,place)))
    9999      (multiple-value-bind (dummies vals newval setter getter)
    100         (get-setf-expansion place)
     100        (get-setf-expansion place env)
    101101        (do* ((d dummies (cdr d))
    102102              (v vals (cdr v))
Note: See TracChangeset for help on using the changeset viewer.