Re: Cross-platform toolkit with a Cocoa backend
Re: Cross-platform toolkit with a Cocoa backend
- Subject: Re: Cross-platform toolkit with a Cocoa backend
- From: Uli Kusterer <email@hidden>
- Date: Thu, 12 Jul 2007 12:42:33 +0200
On 12.07.2007, at 10:49, Felipe Monteiro de Carvalho wrote:
On 7/11/07, Ofri Wolfus <email@hidden> wrote:
After all, ObjC can be implemented purely in a
preprocessor, and you can do by hand what the preprocessor would do
for you.
Do you know of where one can download such preprocessor? (In the
hipotesys that it exists)
I was looking for examples about how to transform objective-c code
into calls to the rtl, and this would be excelent =)
Shouldn't be too hard. In the header that contains objc_msgSend(),
there's lots of comments and also other functions that let you create
or look up selectors etc., and there's also docs for that in Xcode's
documentation viewer. I've used objc_msgSend() in a little compiler
thingie I was working on, and it's really just a function call. The
only thing I haven't yet tried is subclass a class. But for that, you
could probably have a peek at the runtime data structures (also in
that header) and the source code for method swizzling that's out on
the web (which uses them to add a method, and is linked from the
http://cocoadev.com Wiki).
Between those and a bit of stubborn trial-and-error, you should be
able to work it out fairly easily. Of course, if you know assembly,
you could also just go and use GCC's -S option to compile an ObjC
program into an assembly source file and use that to see what ObjC does.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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