bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnustep/base modifications for OSX


From: Richard Frith-Macdonald
Subject: Re: gnustep/base modifications for OSX
Date: Tue, 28 Jan 2003 16:49:21 +0000


On Tuesday, January 28, 2003, at 03:30  pm, Adam Fedor wrote:



Begin forwarded message:

From: St├ęphane Corth├ęsy <stephane@sente.ch>
Date: Mon Jan 27, 2003  5:14:55 PM America/Denver
To: Adam Fedor <fedor@doc.com>
Subject: Re: gnustep/base modifications for OSX

Hi,


First, an important question: why do GCArray and GCMutableArray implement -mutableCopyWithZone: as a deep copy, i.e. content is copied, not retained??? NSArray and NSMutableArray don't do that. This might break applications (and in fact it did: I couldn't run my GDL2 tests until I discovered that).

I've changed that (for consistency with our other classes) ... but it's not a bug as such.

The MacOS-X release notes on copying containers specifically say you should *NOT* assume anything about whether a copy is shallow or deep ... so an application which depends on a specific behavior is broken! In particular, some of the abstract class copy method implementations differ from those of the concrete classes!

If an application needs a specific behavior, it should not copy an array, but rather should use retain, or should create a new array and initialise it using -initWithArray:copyItems: setting the flag to say whether items should be copied or merely retained (the same applies to dictionaries and sets).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]