On Jun 7, 2008, at 12:37 PM, Kevin Grant wrote:
It is possible to link your application through C to an interpreter like Python or Perl, and rely on the built-in regular expression libraries to do your work. If you really wanted to, you could fire off a call to /usr/bin/egrep.
That last one would possibly be the worse of all possible ways - the cost involves spanning another process (potentially for each regex), sending a potentially large string to it, parsing the output back from it to get any sort of results, made all the more complicated by the fact that there are all sorts of weird involved when sending non-ASCII to another process (since environment variables get involved to determine encoding schemes - and you have no way of knowing what the user set up in the hand full of default encoding environment parameters that exist).
NSTask works great for some things - shlepping large amount of string data back and forth for a simple utility isn't one of them.
These are all part of the default Mac OS X platform, they require no dependency on a bundled framework, and have no license issues.
Can't speak for Perl, but the Python framework changes from OS version to OS version, which can potentially cause problems with linking to it, so suddenly this introduces an OS dependency. There is no "forward compatibility guarantee" that is implicit in various parts of AppKit (granted, there are occasionally problems there, but those tend to be the except
In all honesty, you wouldn't want Apple to "implement" this itself, because they'd have to start from scratch and there would be bugs. I listed 3 implementations that are very mature and powerful.
Except that there already is a very good regex engine as part of the OS (ICU) which is used by some parts of the system already - it's just not fully exposed in Cocoa (so it's not like they'd be implementing it from scratch at all). Asking that they take that last step seems like a very reasonable request (and it has been discussed for many-an-OS- release).
Glenn Andreas [EMAIL PROTECTED] <http://www.gandreas.com/> wicked fun! m.o.t.e.s. | minute object twisted environment simulation _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]