• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Obj-C equivalent to Python generator functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Obj-C equivalent to Python generator functions (From: Sam Krishna <email@hidden>)

  • Prev by Date: Seeking advice on best practice for managing visibility of many subviews
  • Next by Date: Re: Cocoa Access to iPhone info
  • Previous by thread: Obj-C equivalent to Python generator functions
  • Next by thread: Re: Obj-C equivalent to Python generator functions
  • Index(es):
    • Date
    • Thread