1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-23 21:10:29 +02:00

* 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.)

* 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:15:06 +00:00
parent 55f8c6f1ca
commit 168629c99a
5 changed files with 32 additions and 6 deletions

11
NEWS
View file

@ -44,7 +44,18 @@ correctly.
The class layout slot, which informs the GC about which slots to GC The class layout slot, which informs the GC about which slots to GC
protect, is now initialized correctly. protect, is now initialized correctly.
** GOOPS class redefinition bug fixed.
The class redefinition protocol now properly removes the old accessor
methods from their accessors.
* Changes to Scheme functions and syntax * Changes to Scheme functions and syntax
** %fast-slot-ref no longer checks slot boundness
This makes the <active-class> metaclass in (oop goops active-slot)
working again.
* Changes to the C interface * Changes to the C interface

View file

@ -1,3 +1,9 @@
2003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* 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.)
2003-04-14 Mikael Djurfeldt <djurfeldt@nada.kth.se> 2003-04-14 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* print.c (scm_prin1): Remember old state of pstate->writingp. * print.c (scm_prin1): Remember old state of pstate->writingp.

View file

@ -1066,7 +1066,7 @@ SCM_DEFINE (scm_sys_fast_slot_ref, "%fast-slot-ref", 2, 0, 0,
i = SCM_INUM (index); i = SCM_INUM (index);
SCM_ASSERT_RANGE (2, index, i >= 0 && i < SCM_NUMBER_OF_SLOTS (obj)); SCM_ASSERT_RANGE (2, index, i >= 0 && i < SCM_NUMBER_OF_SLOTS (obj));
return scm_at_assert_bound_ref (obj, index); return SCM_SLOT (obj, i);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -1,3 +1,9 @@
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.)
2003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se> 2003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* goops.scm (compute-getters-n-setters/verify-accessors): Better * goops.scm (compute-getters-n-setters/verify-accessors): Better

View file

@ -909,7 +909,13 @@
(define-method (remove-class-accessors! (c <class>)) (define-method (remove-class-accessors! (c <class>))
(for-each (lambda (m) (for-each (lambda (m)
(if (is-a? m <accessor-method>) (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))) (class-direct-methods c)))
;;; ;;;
@ -975,10 +981,7 @@
(make <accessor-method> (make <accessor-method>
#:specializers (list class) #:specializers (list class)
#:procedure (cond ((pair? g-n-s) #:procedure (cond ((pair? g-n-s)
(if init-thunk (make-generic-bound-check-getter (car g-n-s)))
(car g-n-s)
(make-generic-bound-check-getter (car g-n-s))
))
(init-thunk (init-thunk
(standard-get g-n-s)) (standard-get g-n-s))
(else (else