[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>

I'll try to be brief so we can discuss all this. tl;dr: RubySpec is

19 messages 2015/01/05

[ruby-core:67820] [ruby-trunk - Misc #10783] String#concat has an "appending" behavior

From: sawadatsuyoshi@...
Date: 2015-01-26 20:15:30 UTC
List: ruby-core #67820
Issue #10783 has been updated by Tsuyoshi Sawada.



I see. You are assimilating the ordinary word "concatenation" with the Ruby method name `concat`. But I Agree that the documentation is misleading. It should avoid such confusing wording.

----------------------------------------
Misc #10783: String#concat has an "appending" behavior
https://bugs.ruby-lang.org/issues/10783#change-51228

* Author: Antonio Scandurra
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Ruby String documentation (http://www.ruby-doc.org/core-2.2.0/String.html) introduces the two terms **Appending** and **Concatenation**:

- Concatenation (aka `+`) —Returns a new String containing other_str concatenated to str.
- Append (aka `<<`) —Concatenates the given object to str. 

However, calling `concat` results in an appending operation. I find this particularly confusing and against the Principle of Least Surprise (e.g. I'd expect `concat` to actually concatenate something). On the other hand I understand that changing such a small method would result in a quite significant breaking change.

Do you see this as an inconsistency? If yes, is there any particular design (or historical) reason behind it?

Thank you.

P.s. Seems like this is the case for `Array` as well.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next