Re: Mutable and Immutable Designs
Re: Mutable and Immutable Designs
- Subject: Re: Mutable and Immutable Designs
- From: Ondra Cada <email@hidden>
- Date: Sat, 5 Jun 2004 01:51:45 +0200
Wade,
On 5.6.2004, at 1:30, Wade Tregaskis wrote:
>
Well, yeah - you can make immutable's subclasses of your mutable, but
>
that creates a few issues, not the least of which being what happens
>
when someone extends your mutable version with a category, which will
>
then magically work on your immutable version as well - probably not a
>
good idea. :)
*DEFINITELY* not a good idea. Alas, due to the Apple strange (I would
say buggy myself) CF-based design, not quite unheard-of:
166 /tmp> <q.m
#import <Foundation/Foundation.h>
@implementation NSMutableArray (Wow)
-(void)foo { NSLog(@"wow"); }
@end
int main() {
[NSAutoreleasePool new];
[[NSArray array] foo];
return 0;
}
167 /tmp> cc -Wall -framework Foundation q.m && ./a.out
2004-06-05 01:50:22.484 a.out[16368] wow
168 /tmp>
:(((
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.