From 81211c73cc7228612bacc255b35b46f29bd203d8 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Tue, 7 Nov 2000 02:18:52 +0000 Subject: [PATCH] * goops.scm (internal-add-method!): Set n-specialized of a generic function to the number of specializers regardless if it has rest args or not. --- oop/goops.scm | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/oop/goops.scm b/oop/goops.scm index 892cb9ab6..94d4e1d12 100644 --- a/oop/goops.scm +++ b/oop/goops.scm @@ -531,21 +531,8 @@ (slot-set! gf 'methods (compute-new-list-of-methods gf m)) (let ((specializers (slot-ref m 'specializers))) (slot-set! gf 'n-specialized - (let ((n-specialized (slot-ref gf 'n-specialized))) - ;; The magnitude indicates # specializers. - ;; A negative value indicates that at least one - ;; method has rest arguments. (Ugly but effective - ;; space optimization saving one slot in GF objects.) - (cond ((negative? n-specialized) - (- (max (+ 1 (length* specializers)) - (abs n-specialized)))) - ((list? specializers) - (max (length specializers) - n-specialized)) - (else - (- (+ 1 (max (length* specializers) - n-specialized))))) - ))) + (max (length* specializers) + (slot-ref gf 'n-specialized)))) (%invalidate-method-cache! gf) (add-method-in-classes! m) *unspecified*) -- 2.20.1