Re: Objective-C Question
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.