Deprecation of implicit string concatenation

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 2 04:44:16 PDT 2017


On Sunday, 2 April 2017 at 10:55:22 UTC, Johan Engelen wrote:
>   a ~ "abc"  "def";

If the order is important, make it `a ~ ("abc" ~ "def")` instead. 
I'd argue that with concatenation usually being left-associative, 
clearly stating the intention to evaluate the side first would be 
a good idea anyway.

But even if you didn't agree with this line of thought, wouldn't 
having to add a pair of parentheses here and there be a small 
price to pay for avoiding a very real source of bugs? Or are you 
just worried about the deprecation message leading people into 
inadvertently introducing a behaviour change when they just 
mechanically applied the fix to the code?

  — David


More information about the Digitalmars-d mailing list