[MacRuby-devel] Potential macirb issue

Eloy Duran eloy at dekleineprins.me
Fri Mar 11 02:21:48 PST 2011


This worked fine on an older version of trunk that I had installed,
but with the current trunk I can confirm the same problem. Can you
please file a ticket?

On Thu, Mar 10, 2011 at 9:01 PM, Mark Rada <mrada at marketcircle.com> wrote:
> Hey all,
>
> I am getting an error when I add a #to_s method to NSURL:
>
>         ± irb
>        irb(main):001:0> class NSURL
>        irb(main):002:1>   alias_method :to_s, :absoluteString
>        irb(main):003:0> end
>        => NSURL
>        irb(main):004:0> NSURL.URLWithString( 'macruby.org' )
>        RuntimeError: can't modify frozen/immutable string
>
>        irb(main):005:0> test = NSURL.URLWithString( 'macruby.org' )
>        RuntimeError: can't modify frozen/immutable string
>
>        irb(main):006:0> test.to_s
>        => "macruby.org"
>        irb(main):007:0>
>
> So the error seems to be macirb trying to do something to the string that is returned from #to_s.
>
> I'm not sure if this is unique to MacRuby, as the CRuby documentation for Object#to_s doesn't say whether the returned object should be frozen, but should I be making #to_s return a mutable/unfrozen string?
>
>
> Mark Rada
> mrada at marketcircle.com
>
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>


More information about the MacRuby-devel mailing list