[MacRuby-devel] next release

Benjamin Stiglitz ben at tanjero.com
Thu Mar 13 18:05:58 PDT 2008


>> Could we add a category on NSString that auto-converts it to an  
>> NSMutableString when necessary?
>
> Well there is already [-mutableCopy] which when called on an  
> NSString returns an NSMutableString. But you have to call it, the  
> process is not done automatically for you.
>
> Say that you receive a non-mutable string from Objective-C, and want  
> to call the #upcase! method on it. AFAIK, MacRuby could 1) raise an  
> exception 2) auto-convert the receiver as mutable (but a new object  
> will likely have to be created).

There's no way to do this switch in the general case of incoming  
CFTypes. Can we easily fudge the locals table to point to a new object  
in YARV?

-Bem


More information about the MacRuby-devel mailing list