Craig Lanning <[EMAIL PROTECTED]> writes:

> The application runs to completion. :-)

That looks promising :).  I think is the real fix should then be the
patch below.  Could you please try this one, too?

(in-package :pcl)

(defun call-ctor (class initargs)
  (flet (;;
         ;; Return two values ARGS, MATCH-P.  ARGS is a list of values
         ;; from INITARGS with which the ctor can be invoked.  MATCH-P
         ;; true means the ctor can be used.
         (call-args (ctor)
           (loop for (key value) on initargs by #'cddr
                 for (ctor-key ctor-value) on (ctor-initargs ctor) by #'cddr
                 when (or (not (eq key ctor-key))
                          (and (constantp ctor-value)
                               (not (eql value ctor-value))))
                   return nil
                 unless (constantp ctor-value)
                   collect value into args
                 finally
                   (return (values args match-p)))))
    ;;
    ;; Loop over all ctors of CLASS looking for a ctor that can be
    ;; used to construct an instance with the given initargs.  If one
    ;; is found, invoke it and return its value.
    (dolist (ctor (plist-value class 'ctors))
      (when (eq (ctor-state ctor) 'optimized)
        (multiple-value-bind (args match-p)
            (call-args ctor)
          (when match-p
            (return (apply ctor args))))))))

Reply via email to