[Truffle] Adding Array#shuffle to array.rb.#2676
Conversation
There was a problem hiding this comment.
This shouldn't need to be changed as @tuple.swap should work fine. We handle that in BodyTranslator.
|
@nirvdrum regarding your comments, here is some discussion from jruby channel, does this make sense? |
|
This makes sense. We've just been avoiding modifications to the Rubinius source where we can. Since I'm coming into this one late, I'll let @chrisseaton review. |
|
And not to overly complicate things, but I had a similar issue with jruby/truffle/src/main/ruby/core/shims.rb Lines 204 to 226 in 5a506d2 and passed the String bytes in BodyTranslator: jruby/truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java Lines 1593 to 1600 in 5a506d2 That's not to say what I did was right or better, but it's another option. Our notion of |
|
The extra wrapper might work well for But whatever works for you @bjfish and is clean is good. It's better to try out some different ideas at this stage than it is to work too hard to make everything totally consistent. Can you move to |
|
@chrisseaton I think I would @nirvdrum would you be able to help in modifying body translator so that @tuple returns a Tuple.class |
|
The method can still be a member of |
|
@nirvdrum let me know what you think of the update, I still left the shuffle method modified to use |
|
My preference is to use |
|
@nirvdrum Okay, I've updated this to make swap public and use @tuple.swap |
|
Looks good. If it turns out I'm a moron, we can move this back easily enough :-) |
[Truffle] Adding Array#shuffle to array.rb.
No description provided.