#744: map on an array delivered by terminal app via scripting bridge gives an immutable error ----------------------------+----------------------------------------------- Reporter: jazz...@… | Owner: lsansone...@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------+----------------------------------------------- Changes (by martinlagarde...@…):
* 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/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel