Changeset 13761


Ignore:
Timestamp:
01/11/12 16:28:53 (9 years ago)
Author:
ehuelsmann
Message:

Better context reporting during initarg checking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r13726 r13761  
    697697                    (list* class initargs)
    698698                    class t initargs
    699                     *make-instance-initargs-cache*)
     699                    *make-instance-initargs-cache* 'make-instance)
    700700    (%set-class-name name class)
    701701    (%set-class-layout nil class)
     
    27652765(defun check-initargs (gf-list args instance
    27662766                       shared-initialize-param initargs
    2767                        cache)
     2767                       cache call-site)
    27682768  "Checks the validity of `initargs' for the generic functions in `gf-list'
    27692769when called with `args' by calculating the applicable methods for each gf.
     
    27912791              (unless (memq initarg allowable-initargs)
    27922792                (error 'program-error
    2793                        :format-control "Invalid initarg ~S."
    2794                        :format-arguments (list initarg))))))))
     2793                       :format-control "Invalid initarg ~S in call to ~S ~
     2794with arglist ~S."
     2795                       :format-arguments (list initarg call-site args))))))))
    27952796
    27962797(defun merge-initargs-sets (list1 list2)
     
    28382839                    (list* instance initargs)
    28392840                    instance t initargs
    2840                     *make-instance-initargs-cache*)
     2841                    *make-instance-initargs-cache* 'make-instance)
    28412842    (apply #'initialize-instance instance initargs)
    28422843    instance))
     
    28612862  (check-initargs (list #'reinitialize-instance) (list* instance initargs)
    28622863                  instance () initargs
    2863                   *reinitialize-instance-initargs-cache*)
     2864                  *reinitialize-instance-initargs-cache* 'reinitialize-instance)
    28642865  (apply #'shared-initialize instance () initargs))
    28652866
     
    28752876    (unless (symbolp initarg)
    28762877      (error 'program-error
    2877              :format-control "Invalid initarg ~S."
     2878             :format-control "Initarg ~S not a symbol."
    28782879             :format-arguments (list initarg))))
    28792880  (dolist (slot (class-slots (class-of instance)))
     
    29532954                    (list old new initargs)
    29542955                    new added-slots initargs
    2955                     nil)
     2956                    nil 'update-instance-for-different-class)
    29562957    (apply #'shared-initialize new added-slots initargs)))
    29572958
     
    29862987                         property-list initargs)
    29872988                  instance added-slots initargs
    2988                   nil)
     2989                  nil 'update-instance-for-redefined-class)
    29892990  (apply #'shared-initialize instance added-slots initargs))
    29902991
     
    30033004                  (list* class all-keys)
    30043005                  class t all-keys
    3005                   nil)
     3006                  nil 'reinitialize-instance)
    30063007  (apply #'std-after-initialization-for-classes class all-keys))
    30073008
Note: See TracChangeset for help on using the changeset viewer.