• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mutable and Immutable Designs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Mutable and Immutable Designs (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: Re: Mutable and Immutable Designs
  • Next by Date: Re: cocoa-dev digest, Vol 2 #4302 - 16 msgs
  • Previous by thread: Re: Mutable and Immutable Designs
  • Next by thread: The best way to determine if my app is already running
  • Index(es):
    • Date
    • Thread