On May 23, 2008, at 3:49 PM, Sherm Pendley wrote:

The implementation of foreach appears almost expressly designed to better support scripting languages. The ObjC foreach() syntax is just chrome - the "fast" comes from under the hood. It compiles down to a single method that's called to get a count of items and a C array of ids. For a scripting bridge, an opportunity to replace several trips across the bridge per iteration with
a single round trip for the whole array is *huge*.



I actually consider the "for each" to be the "stealth viral" feature (much like "//" style comments were with C++).

After having used them in an ObjC 2.0 project, I hate the thought of turning back to the old "declare yet another enumerator, while (ugly expression that's also a statement)" style in pre-ObjC 2.0.

While properties are nice, it's the "for each" thing that really is thing I miss most when not working in ObjC 2.0... (if only the equivalent NSEnumerator based loop were automatically generated in non ObjC 2.0)


Glenn Andreas                      [EMAIL PROTECTED]
 <http://www.gandreas.com/> wicked fun!
m.o.t.e.s. | minute object twisted environment simulation



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to