cleanup on aisle 5

db4
Joe Groff 2008-09-12 20:18:47 -07:00
parent 332d514a8e
commit 3e0ea36346
1 changed files with 6 additions and 3 deletions

View File

@ -9,17 +9,20 @@ IN: cocoa.subclassing
: init-method ( method -- sel imp types )
first3 swap
[ sel_registerName ] [ execute ] [ ascii string>alien ] ;
[ sel_registerName ] [ execute ] [ ascii string>alien ]
tri* ;
: throw-if-false ( YES/NO -- )
zero? [ "Failed to add method or protocol to class" throw ] when ;
zero? [ "Failed to add method or protocol to class" throw ]
when ;
: add-methods ( methods class -- )
swap
[ init-method class_addMethod throw-if-false ] with each ;
: add-protocols ( protocols class -- )
swap [ objc-protocol class_addProtocol throw-if-false ] with each ;
swap [ objc-protocol class_addProtocol throw-if-false ]
with each ;
: (define-objc-class) ( protocols superclass name imeth -- )
-rot