Re: [Pyobjc-dev] Bridging NSMutableString, a compromise
Brought to you by:
ronaldoussoren
From: Jack J. <Jac...@or...> - 2003-02-07 22:36:09
|
On vrijdag, feb 7, 2003, at 19:07 Europe/Amsterdam, Ronald Oussoren wrote: >> The only mutable strings that we want to represent as Pythonic string >> lookalikes are those returned in places where the promise was that we >> would get an >> NSString. > The only way to detect that the API promises to return an (immutable) > NSString is by parsing header files, as far as the Objective-C runtime > (and therefore PyObjC) is concerned all classes are the same when > mentioned in method signatures. I keep forgetting that. That basically kills the whole idea. Still, I think the whole idea of this double-headed-monster-string is far to complex for the problem we're trying to solve. If we would just return the actual object, i.e. an NSString or NSMutableString, all our problems would disappear, except for one: it is cumbersome (not to mention butt-ugly) to have to do obj.NSStringAsCString(), or even str(obj), on 99% of all the NSStrings you get back from objc. I have a half-baked idea on how this may be solvable, in a way that may also allow us to get rid of the underscores in method names for 99% of the usage, and possibly more. I'll get back when I've done a bit more thinking. -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |