Re: Function definitions
Re: Function definitions
- Subject: Re: Function definitions
- From: Ondra Cada <email@hidden>
- Date: Tue, 11 Apr 2006 23:14:03 +0200
Scott,
On 11.4.2006, at 23:04, Ondra Cada wrote:
Well, header files *could* be eliminated and the info extracted from
implementation files
No they could not. Far as function/message prototypes go you are of
course right
Oh, and one a-propos: you are right they could, but the language
would have to be extended considerably so as it also makes sense.
Consider this:
// header defines the *only* public part
@interface PublicClass:NSObject
-(void)thisIsPublic;
@end
// implementation defines *much more*, and you would have to add tags
to specify what's what:
@interface PrivateClass:PublicClass ... @end
@implementation MyClass
-(void)thisIsPrivateMethod { ... }
-(void)thisIsPublic {
...
[self thisIsPrivateMethod];
}
-init {
[self release];
return [[PrivateClass alloc] init];
}
@end
Although runtime of course both the classes and both the methods are
equally public, the compile-time difference (where any explicit usage
of thisIsPrivateMethod or PrivateClass would yield automatically a
warning or an error) is very important.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden