From 593f25fde4c14b5186f31d520d046b59cb62e04e Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 8 Sep 2008 22:09:05 -0700 Subject: [PATCH] clean up. disable method type verification for debugging --- basis/cocoa/messages/messages.factor | 14 +++++--------- basis/cocoa/subclassing/subclassing.factor | 17 +++++++++-------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 413cab3b6d..ceb3a0021c 100755 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -102,15 +102,6 @@ MACRO: (send) ( selector super? -- quot ) : objc-meta-class ( string -- class ) \ objc_getMetaClass (objc-class) ; -USE: prettyprint -: (.) ( foo bar -- foo ) - . dup . ; - -: method-arg-type ( method i -- type ) - method_copyArgumentType - [ ascii alien>string parse-objc-type ] keep - (free) ; - SYMBOL: objc>alien-types H{ @@ -164,6 +155,11 @@ H{ : parse-objc-type ( string -- ctype ) 0 swap (parse-objc-type) ; +: method-arg-type ( method i -- type ) + method_copyArgumentType + [ ascii alien>string parse-objc-type ] keep + (free) ; + : method-arg-types ( method -- args ) dup method_getNumberOfArguments [ method-arg-type ] with map ; diff --git a/basis/cocoa/subclassing/subclassing.factor b/basis/cocoa/subclassing/subclassing.factor index 45071f1cec..eb7cc60cca 100755 --- a/basis/cocoa/subclassing/subclassing.factor +++ b/basis/cocoa/subclassing/subclassing.factor @@ -43,16 +43,17 @@ IN: cocoa.subclassing : types= ( a b -- ? ) [ ascii alien>string ] bi@ = ; -: (verify-method-type) ( class sel types -- ) - [ class_getInstanceMethod method_getTypeEncoding ] - dip types= - [ "Objective-C method types cannot be changed once defined" throw ] - unless ; -: verify-method-type ( class sel imp types -- class sel imp types ) - 4 ndup nip (verify-method-type) ; +! : (verify-method-type) ( class sel types -- ) +! [ class_getInstanceMethod method_getTypeEncoding ] +! dip types= +! [ "Objective-C method types cannot be changed once defined" throw ] +! unless ; +! : 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 + init-method ! verify-method-type + drop [ class_getInstanceMethod ] dip method_setImplementation drop ; : redefine-objc-methods ( imeth name -- )