Changeset 13597


Ignore:
Timestamp:
09/17/11 20:46:45 (10 years ago)
Author:
ehuelsmann
Message:

Fix issue reported by Eric Marsden: failure to compile functions
with defined source-transforms or compiler-macros, with calls specifying
keyword argument keywords as parameters.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-macro.lisp

    r11391 r13597  
    4646(defmacro define-compiler-macro (name lambda-list &rest body)
    4747  (let* ((form (gensym))
    48          (env (gensym)))
     48         (env (gensym))
     49         (block-name (fdefinition-block-name name)))
    4950    (multiple-value-bind (body decls)
    50         (parse-defmacro lambda-list form body name 'defmacro :environment env)
     51        (parse-defmacro lambda-list form body name 'defmacro :environment env
     52                        ;; when we encounter an error
     53                        ;; parsing the arguments in the call
     54                        ;; (not in the difinition!), return
     55                        ;; the arguments unmodified -- ie skip the
     56                        ;; transform (see also source-transform.lisp)
     57                        :error-fun `(lambda (&rest ignored)
     58                                      (declare (ignore ignored))
     59                                      (return-from ,block-name ,form)))
    5160      (let ((expander `(lambda (,form ,env)
    5261                         (declare (ignorable ,env))
    53                          (block ,(fdefinition-block-name name) ,body))))
     62                         (block ,block-name ,body))))
    5463        `(progn
    5564           (setf (compiler-macro-function ',name) (function ,expander))
  • trunk/abcl/src/org/armedbear/lisp/source-transform.lisp

    r11391 r13597  
    4545  (let* ((form (gensym))
    4646         (env (gensym))
     47         (block-name (if (symbolp name) name (cadr name)))
    4748         (body (parse-defmacro lambda-list form body name 'defmacro
    48                                :environment env))
     49                               :environment env
     50                               ;; when we encounter an error
     51                               ;; parsing the arguments in the call
     52                               ;; (not in the difinition!), return
     53                               ;; the arguments unmodified -- ie skip the
     54                               ;; transform (see also compiler-macro.lisp)
     55                               :error-fun `(lambda (&rest ignored)
     56                                             (declare (ignore ignored))
     57                                             (return-from ,block-name ,form))))
    4958         (expander
    50           (if (symbolp name)
    51               `(lambda (,form) (block ,name ,body))
    52               `(lambda (,form) (block ,(cadr name) ,body)))))
     59           `(lambda (,form) (block ,block-name ,body))))
    5360    `(eval-when (:compile-toplevel :load-toplevel :execute)
    5461       (setf (source-transform ',name) ,expander)
Note: See TracChangeset for help on using the changeset viewer.