From d4835de50bb721c75b69b391f04d187d9c5f93af Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 8 Sep 2008 22:32:19 -0700 Subject: [PATCH] disable method redefinition--is it really necessary when the class is being redefined? --- basis/cocoa/subclassing/subclassing.factor | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/basis/cocoa/subclassing/subclassing.factor b/basis/cocoa/subclassing/subclassing.factor index eb7cc60cca..59635f96df 100755 --- a/basis/cocoa/subclassing/subclassing.factor +++ b/basis/cocoa/subclassing/subclassing.factor @@ -51,17 +51,17 @@ IN: cocoa.subclassing ! : verify-method-type ( class sel imp types -- class sel imp types ) ! 4 ndup nip (verify-method-type) ; -: (redefine-objc-method) ( class method -- ) - init-method ! verify-method-type - drop - [ class_getInstanceMethod ] dip method_setImplementation drop ; - -: redefine-objc-methods ( imeth name -- ) - dup class-exists? [ - objc_getClass swap [ (redefine-objc-method) ] with each - ] [ - 2drop - ] if ; +! : (redefine-objc-method) ( class method -- ) +! init-method ! verify-method-type +! drop +! [ class_getInstanceMethod ] dip method_setImplementation drop ; +! +! : redefine-objc-methods ( imeth name -- ) +! dup class-exists? [ +! objc_getClass swap [ (redefine-objc-method) ] with each +! ] [ +! 2drop +! ] if ; SYMBOL: +name+ SYMBOL: +protocols+ @@ -71,7 +71,7 @@ SYMBOL: +superclass+ clone [ prepare-methods +name+ get "cocoa.classes" create drop - +name+ get 2dup redefine-objc-methods swap [ + +name+ get swap [ +protocols+ get , +superclass+ get , +name+ get , , \ (define-objc-class) , ] [ ] make import-objc-class