• 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: mutability?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mutability?


  • Subject: Re: mutability?
  • From: Philippe Mougin <email@hidden>
  • Date: Thu, 8 Jul 2004 18:32:23 +0200

Fuerthaller wrote:

[...]
> I hope you can aggree on my scenarios that
> there might be some reasonable use cases
> for the mutability status of an object.

Like you I think there are perfectly legitimate use cases where it makes sense to determine at run-time whether a string is mutable, especially in a dynamic language like Objective-C. Yes, this can be misused and dangerous, but no more than the possibility of asking an object about its class. And I hope no one is thinking about removing this feature from Objective-C ;-)

I don't think that the right way to offer information about mutability would be to add a public API. As you noted, the problem at hand comes from the fact that, in the current implementation, non-mutable strings are instances of a subclass of NSMutableString (how something like that can pass design reviews and finds its way into the, otherwise excellent, major framework of a major operating system will be a subject of amazement for generations of developers). Just fix this nonsense and the problem will disappear.

Best,

Philippe Mougin
F-Script: Interactive and scripting environment for Cocoa.
http://www.fscript.org
_______________________________________________
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.


  • Prev by Date: Re: Not assuming 1 point = 1 pixel
  • Next by Date: Re: Bring App to Front
  • Previous by thread: Re: Bring App to Front
  • Next by thread: NSOutlineView and horizontal scroll bar problem
  • Index(es):
    • Date
    • Thread