3 ms·
Runtime modifications to the Objective-C runtime (e.g., objc_allocateClassPair) will have to go through libobjc, just like they do in Objective-C. I could provi
by cornstalks 8y ago
Runtime modifications to the Objective-C runtime (e.g., objc_allocateClassPair) will have to go through libobjc, just like they do in Objective-C. I could provide friendlier interfaces to libobjc, but I don't plan to.
objrs already supports optional methods (for externally-defined protocols), though using them is the same as in Objective-C (you still have to call respondsToSelector: first). I've thought about adding an additional API that simplifies this a bit (i.e., a method that returns an Option, where it's None if the class doesn't respond to the method, or Some(fn) if it does (where fn is a closure you can use to invoke the function)).