From: "jeremyevans0 (Jeremy Evans)" Date: 2021-10-05T15:31:27+00:00 Subject: [ruby-core:105564] [Ruby master Bug#18241] Question on String Concatentation Documentation Issue #18241 has been updated by jeremyevans0 (Jeremy Evans). Backport set to 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN Tracker changed from Misc to Bug This is a documentation bug. Both String#<< and String#concat mutate and return the receiver. I'll fix this shortly. ---------------------------------------- Bug #18241: Question on String Concatentation Documentation https://bugs.ruby-lang.org/issues/18241#change-94018 * Author: hernanat (Anthony Hernandez) * Status: Open * Priority: Normal * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Hello, I noticed that the documentation for `<<` and `concat` both state that the result of each operation is a new string. However, while doing some experimenting myself I noticed that this doesn't seem to be the case. The result has the same object id and memory address as the initial string. I also noticed that the underlying C code fore both of these does seem to return the original string pointer at the end. Is this a documentation issue, or is there something else going on that I'm missing? If the former, I'm happy to put up a PR to fix. If it's the latter, I'd appreciate any explanation. Thanks Anthony -- https://bugs.ruby-lang.org/ Unsubscribe: