Re: Obj-C equivalent to Python generator functions
Re: Obj-C equivalent to Python generator functions
- Subject: Re: Obj-C equivalent to Python generator functions
- From: Andrew Farmer <email@hidden>
- Date: Wed, 1 Apr 2009 20:45:11 -0700
On 01 Apr 09, at 19:04, Sam Krishna wrote:
Does anyone here know of any Obj-C functional equivalent to Python
generator functions? These are *categorically* different that the
Spotlight API generator functions.
Depends on what you're after. If all you need is to be able to iterate
over an object, you can implement fast enumeration:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocFastEnumeration.html
If you actually want the continuation behavior of generators, though,
there's no way to get that in C (or ObjC, or C++) at the moment
without massive, horrifying hacks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden