Re: World Builder Type Application
Re: World Builder Type Application
- Subject: Re: World Builder Type Application
- From: Sherm Pendley <email@hidden>
- Date: Wed, 9 May 2007 16:54:26 -0400
On May 9, 2007, at 4:37 PM, Uli Kusterer wrote:
For your script language, a neat thing you could do with Cocoa
would be to use NSScanner to break it up into lines and those into
words. Define a very simple and strict syntax for now, something like:
<object> <action> <param>
Each object would get a name (one word), and then you'd just search
the current scene for an object of that name, and use
NSSelectorFromString() to turn the action into a SEL, and then use
performSelector: on the object you looked up to call a method of
that name and with that param, after checking whether the SEL is
Nil or the object doesn't respondsToSelector:.
If you want a finished programming language, Lua might also be
worth looking into, I think there's a Cocoa wrapper around that
somewhere on the web. It's not a very pretty language, but easy to
integrate into other applications. Well, IMNSHO it's an ugly
language, but YMMV...
Or Perl, Ruby, Python, FScript, etc. Scripting options for Cocoa apps
are plentiful.
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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