Skip to content
Snippets Groups Projects
  1. Aug 18, 2005
  2. Jul 26, 2005
  3. Jul 13, 2005
  4. Jul 07, 2005
    • rtoy's avatar
      Fix for update-dependent on gfs, from Gerd Moellman, 2005-06-26: · dff333a3
      rtoy authored
      This is for one of Bruno's bug reports.  For example,
      
      (defclass upd-history ()
        ((history :initform ())))
      
      (defmethod update-dependent ((gf generic-function) (history upd-history)
      			     &rest args)
        (push args (slot-value history 'history)))
      
      (defun history-event-list (history)
        (mapcar (lambda (event)
      	    (mapcar (lambda (x)
      		      (if (typep x 'method)
      			  (list 'method (mapcar #'class-name
      						(method-specializers x)))
      			  x))
      		    event))
      	  (reverse (slot-value history 'history))))
      
      (let ((hist (make-instance 'upd-history)))
         (defgeneric upd0 (x))
         (add-dependent #'upd0 hist)
         (defmethod upd0 ((x integer)))
         (history-event-list hist))
      =>  ((add-method (method (integer)))))
      
      But, instead of the above expected result, it produces
      
      =>  (nil (add-method (method (integer)))))
      
      The nil is from a reinitialize-instance of the gf, which is triggered
      by load-defmethod calling ensure-generic-function, which in turn calls
      ensure-generic-function-using-class on the existing gf, which finally
      calls reinitialize-instance.
      
      I'm not 100% sure if this is correct or not.  My reading of CLHS/MOP
      is that this is at least not forbidden.  Opinions?
      
      	* src/pcl/methods.lisp (real-add-method, update-gf-dependents):
      	New function.
      	(real-add-method, real-remove-method): Call it.
      	(reinitialize-instance) <:around standard-generic-function>:
      	Update dependent objects.
      
      	* src/pcl/std-class.lisp (update-dependent): New default method.
      dff333a3
  5. Jun 20, 2005
    • rtoy's avatar
      From Gerd, cmucl-imp, 2005-06-18: · e5d1aeaf
      rtoy authored
      (progn
        (defclass foo92b (foo92a) ((s :initarg :s)))
        (defclass foo92a () ())
        (let ((x (make-instance 'foo92b :s 5)) (update-counter 0))
          (defclass foo92b (foo92a) ((s) (s1) (s2))) ; still subclass of foo92a
          (slot-value x 's)
          (defmethod update-instance-for-redefined-class ((object foo92b) added-slots discarded-slots property-list &rest initargs)
            (incf update-counter))
          (make-instances-obsolete 'foo92a)
          (slot-value x 's)
          update-counter))
      Expected: 1
      Got:      0
      
      [Taken from clisp's clos.tst]
      
      
      	* src/pcl/std-class.lisp (force-cache-flushes): Use new state
      	:obsolete if some superclass has been obsoleted.
      
      	* src/pcl/cache.lisp (check-wrapper-validity): If state is
      	:invalid, recurse because force-cache-flushes can change the
      	state.
      e5d1aeaf
  6. Jun 15, 2005
  7. Jun 14, 2005
    • rtoy's avatar
      From Gerd, cmucl-imp, 2005/06/11: · c231fb42
      rtoy authored
          This week's fix is for something Lynn Quam reported 2004-10-18.
      
          (defclass a (b) ())
      
          (compile nil
      	     (lambda ()
      	       (defclass b ()
      		 ((x :reader b-x)))
      	       (defmethod f ((obj b))
      		 (b-x obj))))
            => error during macro expansion
      
          The fix is:
      
      	    * src/pcl/method-slot-access-optimization.lisp (check-inline-accessor-call-p):
      	    Return nil for forward-referenced classes.
      
      	    * src/pcl/info.lisp (decide-slot-type): Return nil for
      	    forward-referenced classes.
      c231fb42
  8. Jun 06, 2005
    • rtoy's avatar
      Fix CALL-METHOD used outside of emf from. · 0634baa7
      rtoy authored
      Fix from Gerd, cmucl-imp, 2005-06-04 for the following test:
      
          (define-method-combination mc ()
            ((primary () :required t))
            `(restart-case (call-method ,(first primary))
      	 ()))
      
          (defgeneric foo ()
            (:method-combination mc)
            (:method () nil))
      
          (foo)
      
          It turns out this is caused by RESTART-CASE macroexpanding its case
          expression, which it does to see if it starts with ERROR or similar.
          An ANSI thing, if I remember correctly.
      0634baa7
  9. May 31, 2005
    • rtoy's avatar
      Fix for compute-slots, from Gerd, cmucl-imp, 2005-05-28. The test · f3bad3ed
      rtoy authored
      case reported by Bruno is:
      
      #+CMU (use-package "PCL")
      (defclass b (a) ())
      (defmethod compute-slots ((class (eql (find-class 'b))))
        (append (call-next-method)
                (list (make-instance 'standard-effective-slot-definition
                        :name 'y
                        :allocation :instance))))
      (defclass a () ((x :allocation :class)))
      ;; A should now have a shared slot, X, and a local slot, Y.
      (mapcar #'slot-definition-location (class-slots (find-class 'b)))
      
      Instead of an error about no matching method, we get
      
      ((X . PCL::..SLOT-UNBOUND..) 0)
      f3bad3ed
  10. May 23, 2005
    • rtoy's avatar
      Patch from Gerd Moellmann, cmucl-imp, 2005-05-21: · 9976492d
      rtoy authored
          ;; Shared slot becomes local.
          ;; 4.3.6.1.: "The value of a slot that is specified as shared in the old class
          ;;            and as local in the new class is retained."
          (multiple-value-bind (value condition)
      	(ignore-errors
      	  (defclass foo85a () ((size :initarg :size :initform 1 :allocation :class)))
      	  (defclass foo85b (foo85a) ())
      	  (setq i (make-instance 'foo85b))
      	  (defclass foo85a () ((size :initarg :size :initform 2) (other)))
      	  (slot-value i 'size))
            (list value (type-of condition)))
          Expected: (1 NULL)
      9976492d
    • rtoy's avatar
      Patch from Gerd Moellmann, cmucl-imp, 2005-05-21: · 4bbc6932
      rtoy authored
          This is also for something Bruno reported:
      
          The MOP p. 47 says about ensure-class-using-class:
             "The :metaclass argument is a class metaobject class or a class
      	metaobject class name."
          However, CMUCL 19a does not support passing a class here.
      4bbc6932
  11. May 16, 2005
    • rtoy's avatar
      From Gerd Moellman, cmucl-imp, 2005-05-15: · 5f1fcac9
      rtoy authored
          This is another small fix for a problem Bruno reported:
      
          ;; 3.4.10 Define-method-combination Arguments Lambda Lists
          (progn
            (define-method-combination w-args ()
      	((method-list *))
      	(:arguments arg1 arg2 &aux (extra :extra))
      	`(progn , <at> (mapcar #'(lambda (method) `(call-method ,method))
          method-list)))
            (defgeneric mc-test-w-args (p1 p2 s)
      	(:method-combination w-args)
      	(:method ((p1 number) (p2 t) s)
      	  (vector-push-extend (list 'number p1 p2) s))
      	(:method ((p1 string) (p2 t) s)
      	  (vector-push-extend (list 'string p1 p2) s))
      	(:method ((p1 t) (p2 t) s) (vector-push-extend (list t p1 p2) s)))
            (let ((s (make-array 10 :adjustable t :fill-pointer 0)))
      	(mc-test-w-args 1 2 s)
      	s))
          Expected: #((NUMBER 1 2) (T 1 2))
          Got:      ERROR: Lambda-variable is not a symbol: (EXTRA :EXTRA).
      5f1fcac9
  12. Jan 27, 2005
  13. Dec 06, 2004
  14. Oct 05, 2004
  15. Sep 25, 2004
  16. Aug 06, 2004
  17. Jul 11, 2004
  18. Jul 10, 2004
  19. Jul 09, 2004
  20. Apr 14, 2004
  21. Apr 06, 2004
    • rtoy's avatar
      Add support for source location recording, from Helmut Eller on · f4f6325e
      rtoy authored
      cmucl-imp:
      
          The patch below adds a somewhat general mechanism to the get the
          "current location".  So every macro that wants to record the
          source location, can insert a call to SOURCE-LOCATION in the
          generated code and safe the result in a appropriate place.
          SOURCE-LOCATION is a compiler-macro and returns a quoted struct
          with the source info.
      
          The patch adds the definition for SOURCE-LOCATION some
          modifications for the defclass, defgeneric and defmethod macros.
          Classes, generic functions and methods have already a "source"
          slot and the result of SOURCE-LOCATION is just stored into that
          slot.  (The source slot contains currently only the *loadpath*,
          which is is not very useful, if the fasl file is in a different
          directory than the source file.)
      f4f6325e
  22. Apr 02, 2004
  23. Mar 29, 2004
  24. Jan 09, 2004
    • toy's avatar
      Take out the fix for the problem of PCL optimizations being blindly applied · 81dbe24a
      toy authored
      to method parameters which are assigned to.  This fixes a bug that shows up
      in McCLIM.
      
      (From Gerd, on cmucl-imp.)
      81dbe24a
    • toy's avatar
      TRACE was broken if CMUCL wasn't built from a version that included · 495770f3
      toy authored
      PCL, because it needed PCL's walker code.  Fix this by always building
      with PCL's walker, which is independent of PCL:
      
      code/fwrappers.lisp:
      o Always use the PCL version, assuming PCL walker is included.
      
      pcl/defsys.lisp:
      o Don't build walk.lisp here, because it's built as a part of CMUCL.
      o Fix up dependencies.
      
      tools/worldcom.lisp:
      o Compile up pcl/walk.lisp
      
      tools/worldload.lisp:
      o Load up pcl/walk.lisp
      495770f3
  25. Nov 05, 2003
    • gerd's avatar
      (defclass data () ((name :accessor name))) · 5a8847ea
      gerd authored
      	(defmethod name :before ((data data)))
      
      	(name (make-instance 'data))
      	 => too few args in a call to a method function
      
      	This is caused by standard-reader/writer methods having a
      	fast-function, but that's not the one that we should funcall if
      	pcl::*inline-methods-in-emfs* is true.  Use the fast-method-call
      	mechanism for such methods instead.
      
      	* src/pcl/combin.lisp (inlinable-method-p): New function.
      	(make-direct-calls): Removed.
      	(memf-test-converter): Add a local function method-key for
      	determining the function generator key.
      	(memf-code-converter): Add local functions make-call and
      	make-calls.  Generate direct calls if inlinable-method-p returns
      	true.
      5a8847ea
  26. Oct 29, 2003
    • gerd's avatar
      Suppress slot access and gf-call optimizations for method · ef829f5c
      gerd authored
      	parameters that are being assigned to in the method body.
      	Reported by Hans Chalupsky on cmucl-imp.
      
      	* src/pcl/boot.lisp (method-parameter): New function, extracted
      	from make-pv-call.
      	(assigned-method-params): New function.
      	(make-method-lambda-internal): Call it to disable optimizations
      	on method parameters being assigned to.
      
      	* src/pcl/method-slot-access-optimization.lisp
      	(get-param/class-to-optimize): Use new function method-parameter.
      	* src/pcl/gf-call-optimization.lisp (make-pv-call): Ditto.
      
      	* src/pcl/std-class.lisp (ensure-class-using-class): Don't setq
      	a method parameter.
      ef829f5c
  27. Oct 23, 2003
  28. Sep 06, 2003
  29. Sep 05, 2003
  30. Sep 03, 2003
  31. Aug 27, 2003
    • gerd's avatar
      Changes in generic function's method combination don't take · 68f099c4
      gerd authored
      	effect until a method is added or removed from the gf.
      	Reported by Andreas Fuchs on a SBCL mailing list.
      
      	* src/pcl/methods.lisp (reinitialize-instance)
      	<standard-generic-function>: Make it an around method, call
      	flush-effective-method-cache if the method combination changes.
      
      	* src/pcl/dfun.lisp (flush-effective-method-cache): New function.
      	(*effective-method-cache*): Renamed from *effective-method-table*.
      68f099c4
  32. Aug 25, 2003
    • gerd's avatar
      Lazy signaling of errors because of invalid method qualifiers, · 2f40ed5a
      gerd authored
      	for ANSI compliance.
      
      	* src/pcl/defcombin.lisp (compute-effective-method):  If
      	*in-precompute-effective-methods-p*, generate an emf consisting of
      	a call to %invalid-qualifiers if there are such methods.
      
      	* src/pcl/combin.lisp (standard-compute-effective-method): Likewise.
      	(make-effective-method-lambda): Handle %invalid-qualifiers like
      	%no-primary-method.
      
      	* src/pcl/braid.lisp (%invalid-qualifiers): New function.
      	(invalid-qualifiers): New method.
      
      	* src/pcl/generic-functions.lisp (invalid-qualifiers): New gf.
      
      	* src/pcl/dfun.lisp (*max-emf-precomputation-methods*): Set to 100.
      
      	* src/docs/cmu-user/extensions.tex (Effective Method Precomputation):
      	Change description of *max-emf-precomputation-methods*.
      2f40ed5a
  33. Aug 16, 2003
  34. Jul 29, 2003
Loading