* tests/goops.test: Added tests for class redefinition, object

update and active slots.

* goops.scm (compute-getter-method): For custom getter: Check
boundness even if there is an init-thunk.  (The getter can return
#<unbound> even if the slot has been set before.)
(remove-class-accessors!): Also remove accessor-method from its
accessor.

* goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
scm_at_assert_bound_ref.  (We don't want the unbound check.  See
oop/goops/active-slot.scm.)
This commit is contained in:
Mikael Djurfeldt 2003-04-15 01:17:36 +00:00
commit 58241edc7d
6 changed files with 81 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* goops.scm (compute-getter-method): For custom getter: Check
boundness even if there is an init-thunk. (The getter can return
#<unbound> even if the slot has been set before.)
(remove-class-accessors!): Also remove accessor-method from its
accessor.
2003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* goops.scm (compute-getters-n-setters/verify-accessors): Better

View file

@ -1059,7 +1059,13 @@
(define-method (remove-class-accessors! (c <class>))
(for-each (lambda (m)
(if (is-a? m <accessor-method>)
(remove-method-in-classes! m)))
(let ((gf (slot-ref m 'generic-function)))
;; remove the method from its GF
(slot-set! gf 'methods
(delq1! m (slot-ref gf 'methods)))
(%invalidate-method-cache! gf)
;; remove the method from its specializers
(remove-method-in-classes! m))))
(class-direct-methods c)))
;;;
@ -1125,10 +1131,7 @@
(make <accessor-method>
#:specializers (list class)
#:procedure (cond ((pair? g-n-s)
(if init-thunk
(car g-n-s)
(make-generic-bound-check-getter (car g-n-s))
))
(make-generic-bound-check-getter (car g-n-s)))
(init-thunk
(standard-get g-n-s))
(else