4 ms·
Objective-C's blocks would be a million times more interesting to me if they allowed for runtime type inspection: given that they are already fully fledged Obje
by saurik 15y ago
Objective-C's blocks would be a million times more interesting to me if they allowed for runtime type inspection: given that they are already fully fledged Objective-C objects, the fact that they don't have some kind of "methodSignature" selector that returns the type code is simply confusing. If they had this feature, then they would be fully usable from dynamic languages (such as my Cycript, but also things like PyObjC, Nu, etc.) without having to manually specify the types everywhere (which is error prone and annoying, especially if all of the rest of your code is working just fine with no types specified at all). Without this feature, they seem to just be a really limited version of C++0x lambdas tied to Objective-C's reference counting semantics.