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: Fri, 4 Feb 2011 23:10:42 +0000

On 4 Feb 2011, at 13:57, Jens Ayton wrote:

> I can't find a conveniently clean answer to this on the intergoogles, so:
> * Is fast enumeration usable in any stable release version of GNUstep?

Yes, I've been using it in Étoilé stuff for a year or so.

> * If so, what combination of GNUstep version and compiler is necessary?

Relatively recent GNUstep base, clang 2.7 or later (i.e. any version of clang 
that's ever shipped).

The only runtime function required is the one that then calls back to GNUstep 
to throw an exception.  This is implemented in both libobjc2 and in the 
ObjectiveC2 compatibility framework, so there is no requirement to use a 
specific libobjc.

> * To get to the nub of the issue, what nasty #ifing do I need to get my nasty 
> foreach() macro to use fast enumeration if available when building for 
> GNUstep? (Building with distro-standard versions of GNUstep is a higher 
> priority than saving on temporary enumerators, and besides, I still support 
> OS X 10.4 anyway.)

See the FOREACH() macro in étoilé, which uses fast enumeration if available, or 
iterators if not.  Also see the macro in GNUstep, which expands to the same 
thing as the for..in loop.

David


reply via email to

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