3 ms·
A fundamental problem with Objective-C generics that cannot be addressed in an additive manner is that generic parameters just desugar to ‘id’; you cannot use O
by slavapestov 8y ago
A fundamental problem with Objective-C generics that cannot be addressed in an additive manner is that generic parameters just desugar to ‘id’; you cannot use Objective-C generics with C types and you still pay the performance and memory use cost of trafficking exclusively in class instances. This of course was the right trade off, since it allowed generics to be layered on top of existing types like NSArray without either changing their implementation or breaking existing client code. However, when designing a new language with generics built in from the start you can make much better design decisions.