eerolanguage / eero

Eero was a fully binary- and header-compatible dialect of Objective-C, implemented with a modified version of the Apple-sponsored LLVM/clang open-source compiler. It featured a streamlined syntax, Python-like indentation, and other features that improve readability and code safety. It was inspired by languages such as Smalltalk, Python, and Ruby.
https://web.archive.org/web/20171101134337/http://eerolanguage.org/
288 stars 7 forks source link

Support array/dictionary subscript syntax via protocols #51

Open andyarvanitis opened 10 years ago

andyarvanitis commented 10 years ago

Currently, neither standard Objective-C nor Eero recognize subscript methods declared in protocols, e.g.:

@protocol TypedArray <NSObject, NSFastEnumeration>
-(instancetype) objectAtIndexedSubscript: (NSUInteger)index;
@end

NSNumber<TypedArray> * numberArray = ...
Number n = numberArray[0]; // compile error -- method to read element not found

It might be possible to add this ability to Eero.