Morale of a story: ~ is the right choice for concat operator

Dukc ajieskola at gmail.com
Sat May 26 10:08:35 UTC 2018


On Saturday, 26 May 2018 at 09:01:29 UTC, rumbu wrote:
> Sorry, but the mistake here is the fact that you wrongly assume 
> C behavior in C#.

Yes it is. But that does not make differentiating concat and 
addition in language desing any less worthwhile. In car crashes, 
the mistake is usually made by a driver, but I know no-one who 
says safety belts aren't worthwhile.

> Adding chars to an existing string will result in a string as 
> in the language specification.

In fact I didn't make the mistake there. What surprised me was 
that adding two INDIVIDUAL chars result in a string. When op+ is 
srictly for mathematical summing, there are no ambiquites.


More information about the Digitalmars-d mailing list