Re: Fun building on top of JavaScript (Objective-J)
Posted: Thu Dec 18, 2008 4:13 pm
Oh, and before you start pulling hairs out wondering why the most elementary stuff in ObjC isn't working in ObjJ, these two basic structures from ObjC:
And
They only exist as a direct @implementation in ObjJ. You just don't need the header file with a @interface, all you need is a single .j file. It's just that JavaScript is less long-winded than C.
Other things that don't exist in ObjJ (yet):
* Protocols - I've requested it. Protocols are basically what we think of as interfaces in PHP/Java.
* Delcared properties do exist, but slightly differently using @accessors.
* Fast enumeration - JS already took that syntax
Code: Select all
@interface MyClass : NSObject
{
}
- (void)aMethod:(NSString *)str;
@endCode: Select all
@implementation MyClass
{
}
- (void)aMethod:(NSString *)str
{
... implementation here ...
}
@endCode: Select all
@implementation MyClass : CPObject
{
}
- (void)aMethod:(CPString)str
{
... implementation here ...
}
@end* Protocols - I've requested it. Protocols are basically what we think of as interfaces in PHP/Java.
* Delcared properties do exist, but slightly differently using @accessors.
* Fast enumeration - JS already took that syntax