musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Forward declaration syntax changes #120

Closed iccir closed 7 years ago

iccir commented 8 years ago

As mentioned in the Readme, there should be no need to use forward declarations in modern oj. Doing so generally indicates an issue with the dependency tree. That said, there are times during development where a forward declaration is useful (especially when refactoring), so forward declarations shouldn't go away entirely.

The @class keyword is prime real estate that I'd like to repurpose in the future.

For oj 2.x, introduce a @forward keyword for the rare occasion where forward declarations are needed:

@forward @class ForwardDeclaredClass, ForwardDeclaredClass2;

or just:

@forward ForwardDeclaredClass, ForwardDeclaredClass2;