You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Behind the scenes, the oj compiler changes the @implementation/@EnD block into a JavaScript function block. Hence, private functions and variables may be declared inside of an @implementation without polluting the global namespace.
This differs in behavior from Objective-C. Consider the following:
@interface Foo : NSObject
@end
@implementation Foo
static int sInt = 0;
static void sFoo() { }
int theInt = 0;
void foo() { }
@end
sInt, sFoo, theInt, and foo are all visible/callable from outside of the @implementation block:
int main(int argc, const char * argv[])
{
sFoo();
foo();
sInt = theInt + 4;
return 0;
}
If changed, this would require a major bump.
Note: I don't think this change should occur for its own sake; rather, it's an ok change to make if #86 requires it.
The text was updated successfully, but these errors were encountered:
Per the oj 0.x and 1.x documentation:
This differs in behavior from Objective-C. Consider the following:
sInt
,sFoo
,theInt
, andfoo
are all visible/callable from outside of the@implementation
block:If changed, this would require a major bump.
Note: I don't think this change should occur for its own sake; rather, it's an ok change to make if #86 requires it.
The text was updated successfully, but these errors were encountered: