Project

General

Profile

Actions

Bug #18241

closed

Question on String Concatentation Documentation

Added by hernanat (Anthony Hernandez) about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:105562]

Description

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


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #18261: String#prepend inconsistent documentationClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0