Skip to content
Snippets Groups Projects
  1. 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
  2. Sep 05, 2003
  3. 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
  4. Jul 29, 2003
  5. Jul 21, 2003
  6. Jun 06, 2003
    • gerd's avatar
      Various problems with TYPE-OF found by Paul Dietz. · f847c099
      gerd authored
      	* src/pcl/methods.lisp (setf class-name) <before>: New method
      	setting the kernel class' name.
      
      	* src/code/pred.lisp (type-of): Don't return list function types.
      	Return boolean for t, (integer n n) for integers, keyword for
      	keywords, standard-char for standard characters.  Return
      	the CLOS class for classes not having a proper name.
      f847c099
  7. Jun 05, 2003
  8. Jun 04, 2003
  9. May 28, 2003
    • gerd's avatar
      Structure slot names can be any symbol. Found by Paul Dietz. · 3bbc7259
      gerd authored
      	* src/pcl/std-class.lisp (*allow-funny-slot-names*): Renamed
      	from *allow-keyword-slot-names*.
      
      	* src/pcl/methods.lisp (legal-slot-name-p): Allow any symbol
      	if *allow-funny-slot-names* is true.
      	(shared-initialize): Print the value of the :slot-name initarg.
      
      	* src/code/defstruct.lisp (parse-1-dsd): Treat nil as symbol
      	when used as a slot name.
      3bbc7259
  10. May 25, 2003
    • gerd's avatar
      * src-gf/pcl/methods.lisp (function-keywords): Use · e42371af
      gerd authored
      	method-lambda-list instead of method-lambda-list* because
      	the method can't be an early method at this point.
      e42371af
    • gerd's avatar
      CLHS 7.6.5 keyword argument checking for calls to generic · 606c6835
      gerd authored
      	functions.  Found by Paul Dietz, of course.  This also includes
      	some minor code cleanup and a fix for a bug caused by a typo.
      
      	* src-gf/pcl/std-class.lisp
      	(compute-effective-slot-definition-initargs):
      	Reformatted to make it readable on a tty.
      
      	* src-gf/pcl/methods.lisp (set-condition-svuc-method): Fix a typo.
      
      	* src-gf/pcl/low.lisp (parse-lambda-list): Add an ignore
      	declaration.
      
      	* src-gf/pcl/init.lisp (valid-initargs): Use method-lambda-list*.
      
      	* src-gf/pcl/dfun.lisp (use-caching-dfun-p): Use
      	generic-function-methods*.
      	(use-constant-value-dfun-p): Ditto.
      	(use-dispatch-dfun-p): Don't use dispatching dfuns when we must
      	check keyword arguments according to CLHS 7.6.5, because this
      	computes emfs for sets methods that aren't applicable together in
      	the usual sense; this screws up emf keyword argument checking, of
      	course.
      	(make-initial-dfun): Use gf-arg-info*.
      	(update-dfun): Use generic-function-name*.
      	(final-accessor-dfun-type, make-accessor-table)
      	(compute-applicable-methods-using-types)
      	(compute-applicable-methods-using-types): Likewise.
      
      	* src-gf/pcl/combin.lisp (standard-compute-effective-method):
      	Don't use the single-call-method optimization if we must
      	check keyword arguments according to CLHS 7.6.5.
      	(callable-generator-for-emf): Rewritten to add a keyword
      	argument check to the emf.
      	(emfs-must-check-applicable-keywords-p)
      	(compute-applicable-keywords, check-applicable-keywords):
      	New functions.
      	(odd-number-of-keyword-arguments, invalid-keyword-argument):
      	Moved here from boot.lisp.
      	(make-effective-method-lambda): Add a check-applicable-keywords
      	form to the emf, if appropriate.
      	(memf-test-converter, memf-code-converter)
      	(memf-constant-converter): Deal with check-applicable-keywords.
      	(*applicable-methods*): New variable.
      	(make-callable): Bind it.
      	(make-emf-name): Use generic-function-name*.
      
      	* src/pcl/braid.lisp (ensure-non-standard-class): Remove
      	an used branch.
      
      	* src/pcl/boot.lisp (*make-method-lambda-gf-name*): Removed.
      	(expand-defmethod): Don't bind it.
      	(make-method-lambda-internal): Don't add &key to the method
      	function's lambda-list if the gf has &key.
      	(bind-args): Rewritten.  Don't do keyword checking as this is
      	done in emfs now.
      	(get-key-arg, get-key-arg1): Simplified; do less checking.
      	(generic-function-name*, generic-function-methods*)
      	(gf-arg-info*, method-lambda-list*): New functions.
      	(check-method-arg-info): Use them.
      	(gf-lambda-list-from-method): New function.
      	(gf-lambda-list): Use it.  Don't add &allow-other-keys to a
      	gf's lambda-list if a method has &key.
      	(get-generic-function-info): Use gf-arg-info*.
      	(parse-specialized-lambda-list): Add an ignore declaration.
      	(odd-number-of-keyword-arguments, invalid-keyword-argument):
      	Moved to combin.lisp.
      	(check-generic-function-lambda-list): Remove &more stuff
      	because that's checked elsewhere now (and Python can even
      	tell it is).
      
      	* src-gf/pcl/ctor.lisp (install-optimized-constructor): Remove
      	an unmatched ).
      606c6835
  11. May 20, 2003
    • gerd's avatar
      Store user-specified slot names in DEFSTRUCT-SLOT-DESCRIPTIONs, · 20254db5
      gerd authored
      	which is necessary for conforming SLOT-EXISTS-P and
      	MAKE-LOAD-FORM-SAVING-SLOTS.  To bootstrap, using pmai's
      	build scripts:
      
      	1. Copy boot10.lisp to target:bootstrap.lisp and do a full
      	   build.  Choose the CLOBBER-IT restart when asked
      	   (for an unknown reason, it doesn't work to do this
      	   programatically.)
      
      	2. Leave the bootstrap file where it is and do a full build
      	   with the Lisp produced in step 1.
      
      	3. Remove the bootstrap file and do another full build.
      
      	* src/bootfiles/18e/boot10.lisp: New file.
      
      	* src-dsd/code/defstruct.lisp (defstruct-slot-description):
      	Rename slot %name to name.
      	(dsd-%name): New function.
      	(dsd-name): Function removed.
      	(parse-1-dsd): Set dsd-name to the slot symbol.
      
      	* src-dsd/pcl/std-class.lisp (*allow-keyword-slot-names*): New
      	variable.
      	(initialize-internal-slot-functions) <around
      	structure-effective-slot-definition>: New method binding
      	*allow-keyword-slot-names* to true.
      
      	* src-dsd/pcl/methods.lisp (legal-slot-name-p): Allow keywords
      	if *allow-keyword-slot-names* is true.
      20254db5
  12. May 12, 2003
  13. May 11, 2003
    • gerd's avatar
      More SLOT-VALUE etc. on conditions. · f47f1175
      gerd authored
      	* src/pcl/slots.lisp (slot-value-using-class)
      	(setf slot-boundp-using-class) <condition-class>: New methods.
      
      	* src/pcl/std-class.lisp (initialize-internal-slot-functions): Use
      	slot-name->class-table.
      	(shared-initialize): Call update-pv-table-cache-info.
      	(compute-slots) <around condition-class>: New method.
      
      	* src/pcl/slots-boot.lisp (ensure-accessor): Use
      	slot-name->class-table.
      	(get-optimized-std-accessor-method-function)
      	(get-optimized-std-slot-value-using-class-method-function):
      	Handle condition classes.
      
      	* src/pcl/methods.lisp (*condition-slot-value-using-class-method*)
      	(*condition-setf-slot-value-using-class-method*)
      	(*condition-slot-boundp-using-class-method*): New vars.
      	(condition-svuc-method, set-condition-svuc-method): New functions.
      	(update-std-or-str-methods): Handle conditions.
      
      	* src/pcl/generic-functions.lisp (condition-class-p): New gf.
      
      	* src/pcl/dfun.lisp (make-accessor-table): Use
      	slot-name->class-table.
      
      	* src/pcl/defs.lisp (*the-condition-class*): New var.
      	(slot-name->class-table): New function.
      	(condition): New class.
      	(*early-class-predicates*): Add condition-class-p.
      
      	* src/pcl/braid.lisp (bootstrap-meta-braid)
      	(bootstrap-initialize-class): Add condition-class stuff.
      	(bootstrap-make-slot-definitions): Simplified.
      	(bootstrap-make-slot-definition): Use slot-name->class-table.
      f47f1175
  14. May 04, 2003
    • gerd's avatar
      Code cleanup. Use EXTENSIONS package to reduce clutter. · 4e0d7ca0
      gerd authored
      	* src/pcl/defsys.lisp ("PCL", "WALKER"): Use ext.
      	* src/pcl/pkg.lisp ("PCL", "WALKER"): Use ext.
      	* src/pcl/*.lisp: Remove ext: prefixes.
      
      	* src/pcl/low.lisp (symbolicate*): Renamed from symbolicate.
      	* src/pcl/std-class.lisp (shared-initialize):
      	* src/pcl/defs.lisp (get-built-in-class-symbol)
      	(get-built-in-wrapper-symbol):
      	* src/pcl/braid.lisp (initial-classes-and-wrappers)
      	(bootstrap-meta-braid): Use symbolicate*.
      
      	* src/pcl/macros.lisp (dolist-carefully): Removed.
      	(true, false, zero): Moved to defclass.lisp.
      	(printing-random-thing-internal): Removed.
      	(printing-random-thing): Removed.
      	(rassq): Removed.
      	(*keyword-package*): Removed.
      	(make-keyword): Removed; import from cl.
      	(memq, delq, assq): Macros removed, import from ext.
      	(get-declaration): Moved to boot.lisp, where it's used.
      
      	* src/pcl/boot.lisp (get-declaration): Moved here from
      	macros.lisp.
      
      	* src/pcl/methods.lisp (named-object-print-function, print-object):
      	* src/pcl/low.lisp (print-std-instance):
      	* src/pcl/dfun.lisp (print-dfun-info):
      	* src/pcl/cache.lisp (print-cache, print-wrapper):
      	* src/pcl/boot.lisp (make-early-gf):
      	Use print-unreadable-object instead of printing-random-thing.
      
      	* src/pcl/defclass.lisp (true, false, zero): Moved here from
      	macros.lisp.
      
      	* src/pcl/methods.lisp (legal-qualifiers-p)
      	(legal-specializers-p): Use dolist.
      4e0d7ca0
    • gerd's avatar
      Detect odd-length keyword argument lists, invalid keyword · 6d42033b
      gerd authored
      	arguments is methods.  Change lambda-lists of some gfs and methods
      	to include &key, or &key &allow-other-keys.  Bugs found by Paul
      	Dietz in his test suite.
      
      	* src/pcl/boot.lisp (bind-args): Handle the case that &key is
      	in the lambda-list, but no keyword args.
      	(get-key-arg1): Additional argument first-time; check for
      	invalid keyword arguments, and add number of args when true.
      	(get-key-arg): Call get-key-arg1.
      	(odd-number-of-keyword-arguments, invalid-keyword-argument):
      	New functions.
      
      	* src/pcl/init.lisp (make-instance) <symbol, class>: Add &key.
      	(initialize-instance) <slot-object>: Likewise.
      	(reinitialize-instance) <slot-object>: Likewise.
      	(update-instance-for-different-class): Likewise.
      	(update-instance-for-redefined-class): Likewise.
      	(shared-initialize) <slot-object>: Likewise.
      	* src/pcl/std-class.lisp (change-class): Likewise.
      	* src/pcl/slots.lisp (allocate-instance) <standard-class>:
      	(allocate-instance) <structure-class>: Likewise.
      	* src/pcl/methods.lisp (reinitialize-instance) <standard-method>:
      	Likewise.
      	* src/pcl/generic-functions.lisp (change-class)
      	(allocate-instance, update-instance-for-different-class)
      	(update-instance-for-redefined-class): Add &key &allow-other-keys.
      	* src/pcl/fsc.lisp (allocate-instance)
      	<funcallable-standard-class>: Add &key.
      
      	* src/pcl/std-class.lisp (make-defstruct-allocation-function): Fix
      	a paren bug.
      6d42033b
  15. Apr 25, 2003
    • gerd's avatar
      MOP bug fix for problem with (SETF SLOT-VALUE-USING-CLASS) · 6a5af507
      gerd authored
      	reported by Kevin Rosenberg <kevin@rosenberg.net> on cmucl-imp,
      	Tue, 22 Apr 2003 13:28:23 -0600.  There's a test case in
      	the thread on cmucl-imp.
      
      	* src/pcl/methods.lisp (update-slot-value-gf-info):
      	Moved here from slots-boot.lisp.
      	(get-accessor-method-function): Don't pass nil wrappers
      	to get-secondary-dispatch-function.  See comment there.
      	(update-gf-dfun): Remove unused code.
      
      	* src/pcl/slots-boot.lisp (get-accessor-from-svuc-method-function):
      	Move to methods.lisp, where it's used.
      
      	* src/pcl/std-class.lisp (compute-slot-accessor-info): Add
      	comment.
      
      	Code cleanup.
      
      	* src/pcl/std-class.lisp (compute-default-initargs): Don't use a
      	recursive local function for something that can be done with loop
      	in 2 lines.
      6a5af507
  16. Mar 26, 2003
    • gerd's avatar
      * pcl/boot.lisp (parse-defmethod): Rewritten for clarity. Signal · 1e88e890
      gerd authored
      	an error for most cases of null qualifiers.
      
      
      	Improve DESCRIBE on generic functions.
      
      	* pcl/env.lisp (method-specialized-lambda-list): New function.
      	(describe-object): Use it, and use generic-function-lambda-list.
      
      	* pcl/methods.lisp (generic-function-pretty-arglist)
      	(method-pretty-arglist): Remove.
      
      	* pcl/generic-functions.lisp (generic-function-pretty-arglist)
      	(method-pretty-arglist): Remove.
      
      
      	AMOP compliance fixes: Reintroduce class METAOBJECT, make
      	GENERIC-FUNCTION a subclass of STANDARD-OBJECT, remove STD-OBJECT.
      	This basically reverts a change of dtc from 1998.
      
      	* code/describe.lisp (describe-instance): Check for
      	standard-object, not pcl::std-object.
      
      	* pcl/pkg.lisp ("PCL", "CLOS-MOP"): Export more stuff.
      
      	* pcl/generic-functions.lisp: Remove some of the useless comments.
      
      	* pcl/slots.lisp (slot-value-using-class, setf slot-value-using-class)
      	(slot-boundp-using-class, slot-makunbound-using-class): Specialize
      	on standard-object.
      
      	* pcl/slots-boot.lisp (get-optimized-std-accessor-method-function):
      	Remove an std-class-p case.
      
      	* pcl/methods.lisp (update-std-or-str-methods): Use
      	standard-object instead of std-object.
      	(mec-all-classes-internal): Use *the-class-standard-object*
      	instead of *the-class-std-object*.
      	(class-test): Don't consider *the-class-std-object*.
      
      	* pcl/low.lisp (pcl-instance-p) [deftransform]: Use
      	standard-object instead of std-object.
      
      	* pcl/init.lisp (update-instance-for-different-class)
      	(update-instance-for-redefined-class): Specialize on
      	standard-object instead of std-object.
      
      	* pcl/dfun.lisp (accessor-values-internal, make-accessor-table)
      	(make-accessor-table): Use *the-class-standard-object* instead of
      	*the-class-std-object*.
      
      	* pcl/defs.lisp (toplevel): Don't declare *the-class-std-object*
      	special.
      	(standard-object): Single superclass slot-object.
      	(metaobject): New class.
      	(std-object): Class removed.
      	(specializer): Superclass metaobject.
      	(definition-source-mixin, plist-mixin): Superclass
      	standard-object, no metaclass.
      	(documentation-mixin, dependent-update-mixin): No metaclass.
      	(slot-definition, method, generic-function, method-combination):
      	Superclass metaobject.
      
      	* pcl/cache.lisp (raise-metatype): Don't consider std-class.
      
      	* pcl/braid.lisp (bootstrap-meta-braid): Don't braid std-class.
      	(bootstrap-initialize-class): Don't consider std-class.
      1e88e890
  17. Mar 25, 2003
  18. Mar 22, 2003
    • gerd's avatar
      * bootfiles/18e/boot[12].lisp: Bootstrap files for the lisp:class · a1e3ed93
      gerd authored
      = pcl:class part.  To get it booted from 18e, cross-compile using
      boot1.lisp as bootstrap.lisp in pmai's build scripts, then do a
      normal compile with boot2.lisp as bootstrap.lisp with the
      resulting Lisp.
      
      * code/byte-interp.lisp, code/defstruct.lisp, code/describe.lisp:
      * code/error.lisp, code/exports.lisp, code/hash-new.lisp:
      * code/hash.lisp, code/macros.lisp, code/misc.lisp:
      * code/package.lisp, code/pred.lisp, code/sharpm.lisp, code/type.lisp:
      * compiler/dump.lisp, compiler/fndb.lisp, compiler/globaldb.lisp:
      * compiler/proclaim.lisp, compiler/typetran.lisp, compiler/xref.lisp:
      * compiler/generic/primtype.lisp, compiler/generic/vm-type.lisp:
      Changes for to use kernel::class etc.
      
      * code/class.lisp (toplevel): Shadow class, built-in-class etc.
      (class): Give it conc-name %class-.
      (toplevel) [#+bootstrap-lisp-class=pcl-class]: Define old accessors.
      (everywhere): Use new class accessors.
      
      * compiler/generic/vm-fndb.lisp (%make-instance): Change from
      unsafe to flushable and movable.
      
      * code/ntrace.lisp (expand-trace, untrace): Changes for method
      tracing.
      
      * code/profile.lisp (profile, profile-all, unprofile): Method
      profiling.
      
      * pcl/*.text, pcl/bench.lisp, pcl/extensions.lisp:
      * pcl/fast-init.lisp, pcl/precom1.lisp, pcl/precom4.lisp:
      * pcl/structure-class.lisp, pcl/user-instances.lisp:
      Removed.
      
      * tools/pclcom.lisp: Changes for my PCL and lisp:class =
      pcl::class.
      a1e3ed93
  19. Jan 03, 2003
  20. Dec 22, 2002
    • pmai's avatar
      Entomotomy Bug: slot-definition-allocation-not-amop-compliant · c9d71575
      pmai authored
      Added needed second half of patch, from Gerd Moellmann via SBCL, to cure
      newly introduced problem with inheritance of class slots.  Also committed
      modified version (again via SBCL) of Gerd's COMPUTE-SLOTS revamp for more
      modular computation of slot locations.
      c9d71575
  21. Dec 18, 2002
    • pmai's avatar
      Entomotomy Bug: slot-definition-allocation-not-amop-compliant · 13d6fbc3
      pmai authored
      Committed a slightly adjusted patch from Gerd Moellmann, which makes the
      GF slot-definition-allocation return :class for class slots, as specified
      by AMOP, instead of the class object, as it did previously.
      13d6fbc3
    • pmai's avatar
      Entomotomy Bug: pcl-gf-cache-cacheing-not-needed · e8bc6667
      pmai authored
      This commits a patch by Gerd Moellmann which elides the elaborate cacheing
      of GF caches, since modern GCs are usually better at handling this.
      Performance on x86 with generational GC seems unharmed by this, other ports
      using the non-generational GC will have to investigate.  Should this turn
      up performance problems, the patch might get reverted.
      e8bc6667
  22. Nov 28, 2002
  23. Oct 11, 2002
  24. Sep 09, 2002
  25. Aug 26, 2002
    • pmai's avatar
      Huge patch by Gerd Moellmann that removes PCL::ITERATE and PCL::GATHER* · 57eae931
      pmai authored
      in favor of normal CL constructs.  In a similar vein to SBCL, this patch
      also replaces all uses of #'(lambda ...) by just (lambda ...), and
      removes now-dated looking quotes in front of self-evaluating objects,
      like keywords and t/nil.  The patch has been slightly frobbed by me,
      to correct a couple of slight oversights, and make more effective use
      of the loop facility in a number of places.
      57eae931
  26. Mar 13, 2001
  27. May 30, 1999
  28. Dec 20, 1998
  29. Jun 30, 1998
  30. Jun 05, 1998
    • dtc's avatar
      Rework the PCL class hierarchy to better match the disjoint instance · 80942d67
      dtc authored
      and funcallable-instance types within CMUCL. Add the new class
      funcallable-standard-object, and the new class std-object as a
      superclass of both standard-object and
      funcallable-standard-object. Generic-functions are now
      funcallable-standard-objects implemented as FINs and disjoint from
      standard-objects which are implemented as instances in CMUCL, fixing
      some problems in the type system.
      
      This change moves the PCL implementation away from the MOP
      specification which requires that generic-functions be
      standard-objects. However ANSI CL does not require generic functions
      to be standard-objects and the MOP author Gregor Kiczales suggests it
      is appropriate for generic functions to be disjoint from
      standard-objects.
      80942d67
  31. May 27, 1998
  32. Feb 06, 1997
  33. Feb 11, 1994
  34. Jan 13, 1993
  35. Jan 12, 1993
Loading