[MacRuby-devel] [MacRuby] #744: map on an array delivered by terminal app via scripting bridge gives an immutable error
MacRuby
ruby-noreply at macosforge.org
Sat Jun 19 03:22:25 PDT 2010
#744: map on an array delivered by terminal app via scripting bridge gives an
immutable error
----------------------------+-----------------------------------------------
Reporter: jazzbox@… | Owner: lsansonetti@…
Type: defect | Status: closed
Priority: major | Milestone: MacRuby 0.7
Component: MacRuby | Resolution: fixed
Keywords: |
----------------------------+-----------------------------------------------
Changes (by martinlagardette@…):
* status: reopened => closed
* resolution: => fixed
* milestone: => MacRuby 0.7
Comment:
Ok, so the problem was actually how `#map` was implemented on `NSArray`s.
It was using a `-mutableCopy` as the array to modify, but apparently this
doesn't work with `SBElementArray`s. So I went and modified all the ruby
methods on NSArray that would copy + modify an array (`#map`, `#shuffle`,
`#uniq`, etc.) to use `[NSMutableArray arrayWithArray:rcv]` instead. This
might be a little slower, but at least it works :-)/
For the curious, `[[rcv class] arrayWithArray:rcv]` could have been
better, but this doesn't work with `SBEelementArray`s either.
Anyway, fixed with r4253 :-)
--
Ticket URL: <http://www.macruby.org/trac/ticket/744#comment:4>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list