discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Fast enumeration


From: David Chisnall
Subject: Re: Fast enumeration
Date: Wed, 9 Feb 2011 10:05:11 +0000

On 9 Feb 2011, at 06:44, Riccardo Mottola wrote:

> If you want to expose this macro by default in base, I'd refrain from that. 
> However, I guess it can be exposed if Libobjc-2 is used: the correlation with 
> the newer library version and c99 is probably 1. Pre-C99 support (which I 
> guess sums up in gcc-2.95) can be left to Objc-1.x and in this case the fast 
> enumeration macro could be hidden.
> 
> Of course, if Nikolaus comes up with a generic solution, no objections at all.

I'm already using the GSFastEnumeration macros in -base, and have been for 
about six months.  If they are relying on C99 features that I didn't notice, no 
one has reported compilation failures in this time.

Unlike the enumerator solution, this gives the same performance and 
thread-safety as fast enumeration.  I'm not sure what the problem is.  I didn't 
put them in the public headers location, because emulating a compiler in the 
preprocessor seems ugly to me, but if they're generally useful then we can move 
them there.

I also have some similar macros that provide a fast-enumeration style macro for 
iterating over characters in a string, which I should probably add in the same 
place - there are a few places where we are doing very slow string iteration in 
-base.

David

-- Send from my Jacquard Loom




reply via email to

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