Hacker News new | ask | show | jobs
by mulle_nat 895 days ago
Agreed. BOOL in Apple ObjC is a `char` though. That is a constant thorn in the side, when you are doing slightly more sophisticated stuff with argument passing and return values as you actually have to cast a lot (BOOL (*)(id, SEL, ...)).

As the implementer of an Objective-C dialect, I am considering to go the other route and elevate BOOL to NSInteger (sizeof( NSInteger) == sizeof( id) in my case).

Conceivably the compiler could (just) for @properties combine all the BOOL fields into a bitfield, so there would be less grousing about wasted space. Maybe or maybe not.

* https://developer.apple.com/documentation/objectivec/bool?la...

* https://github.com/iterate-ch/rococoa/blob/master/ObjcMsgSen...