Re: Q's about Obj-C
Re: Q's about Obj-C
- Subject: Re: Q's about Obj-C
- From: Ondra Cada <email@hidden>
- Date: Tue, 16 Oct 2001 12:10:42 +0100
Well, for those who already forgotten their old good plain C (which is still
fully supported as part of ObjC):
>
>>>>> Ondra Cada (OC) wrote at Tue, 16 Oct 2001 12:01:48 +0100:
SB>> Think of functions declared in the header as public and ones
SB>> not declared in the header as private.
OC>
OC> Don't think so, since it's wrong.
Functions (and global variables) are _always_ public, unless defined as
"static". Functions don't need to be declared at all -- they can be freely
used (still it is _reasonable_ to declare all functions, but it is not and
never was mandatory). Variables need to be declared as "extern" so as they
are accessible; even if they are not, though, they still stay public (and
would, for example, clash with other public variables named the same way).
In 10.1 the clashes were somewhat diminished by using the two-level
namespace (such thing was a must since we have the Carbon rot, which does not
have any naming discipline at all). From the compiler point of view though
the above rules remain, just they are not in fact enforced that rigidly as in
standard one-level namespace.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc