• 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: Objective-C Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C Question


  • Subject: Re: Objective-C Question
  • From: Allan Odgaard <email@hidden>
  • Date: Sat, 5 Jun 2004 03:30:37 +0200

On 4. Jun 2004, at 18:44, colin schaub wrote:

i'm a newbie to objective c and cocoa, but not to java. i'm used to working with lots of apache open source libraries, and have become very used to constructs such as closures, transformers, predicates and the like.

Surely you did not use closures in Java???

can anyone point me in the correct direction to read about accomplishing similar things in objective c? i'm assuming there are similar approaches.

Don't be sure -- Objective C is a minimalistic object oriented language and doesn't borrow concepts from the world of functional programming (although someone will probably disagree with me, speak about trampoline functions, code blocks in small-talk or similar ;) ).

i've only just barely scratched the surface of objective c syntax, so perhaps i haven't come across these things yet. (obviously).

You can use Objective C++ [1], this gives you access to the standard C++ library which amongst other contains a 'functional' header [2] that tries to add some functional programming features to the language, like transforming function results, binding arguments, composing functions and so on. But no closures, although Boost has a Lambda library [3] for anonymous functions (written "inline") using expression templates. It's quite neat! :)

If you go the Objective C++ path then you may also find CocoaSTL [4] useful, as it serves as a bridge between the standard library and Foundation.

also, anything on reflection would be nice as well.

Objective C do support reflection to some degree, but it's pretty low-level. Documentation can be found in the Objective C reference manual [5] or you can look in /usr/include/objc.




[1] http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ 3objc_language_overview/chapter_3_section_10.html
[2] http://www.sgi.com/tech/stl/table_of_contents.html (chapter 6)
[3] http://www.boost.org/libs/lambda/doc/
[4] http://www.top-house.dk/~aae0030/cocoastl/
[5] http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ 9objc_runtime_reference/chapter_5_section_1.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >how to get printer added notification/event? (From: Gonzalo Castro <email@hidden>)
 >Objective-C Question (From: colin schaub <email@hidden>)

  • Prev by Date: Re: Are Bindings Redundant?
  • Next by Date: NSURL and thread proliferation
  • Previous by thread: Objective-C Question
  • Next by thread: NSTextField and first responder - when does a feature become a bug?
  • Index(es):
    • Date
    • Thread