We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
n = 4 src = "GGC" l = src.length s = src * ((n / l) + 1) puts "n=#{n}" puts "src=#{src}" puts "l=#{l}" puts "s=#{s}" s.slice!(n, l) puts "result: #{s}"
MRI
n=4 src=GGC l=3 s=GGCGGC result: GGCG
JRuby+Truffle
n=4 src=GGC l=3 s=GGCGGC result: GGC
Also
$ hexdump -C ruby_output 00000000 6e 3d 34 0a 73 72 63 3d 47 47 43 0a 6c 3d 33 0a |n=4.src=GGC.l=3.| 00000010 73 3d 47 47 43 47 47 43 0a 72 65 73 75 6c 74 3a |s=GGCGGC.result:| 00000020 20 47 47 43 47 0a | GGCG.| 00000026 $ hexdump -C jruby_output 00000000 6e 3d 34 0a 73 72 63 3d 47 47 43 0a 6c 3d 33 0a |n=4.src=GGC.l=3.| 00000010 73 3d 47 47 43 47 47 43 0a 72 65 73 75 6c 74 3a |s=GGCGGC.result:| 00000020 20 47 47 43 00 0a | GGC..| 00000026
From @vext01
The text was updated successfully, but these errors were encountered:
Simpler:
s = 'GGC' * 2 s.slice!(4, 3) p s
MRI: "GGCG"
"GGCG"
JRuby+Truffle: "GGC\u0000"
"GGC\u0000"
Sorry, something went wrong.
s = 'GGC' * 2 s[4, 3] = '' p s
Same result as before.
s = 'GGC' * 2 #s = 'GGCGGC' m = Rubinius::Mirror.reflect s m.splice 4, 2, '', s.encoding p s
@nirvdrum can I hand this off to you? Something wrong in concat of substrings of repeated ropes.
d9ccfe0
nirvdrum
No branches or pull requests
MRI
JRuby+Truffle
Also
From @vext01
The text was updated successfully, but these errors were encountered: