endsWith: wrong function call, no error

Dicebot public at dicebot.lv
Mon Oct 21 08:37:41 PDT 2013


On Monday, 21 October 2013 at 15:26:17 UTC, Chris wrote:
> Hm. It took me a few minutes to find the bug in my program. I 
> don't know yet what to think of it. If I wanted "!." I would 
> possibly type this. Is there any real world scenario where this 
> behavior could be useful?

It was necessary in C because it does not have built-in string 
concatenation. So only way to define pre-formatted string was 
something like this: `"Error in " __FILENAME__ ", run for your 
lives!"`

It does not seem that needed in D. I was using it out of habit 
but bearophile has convinced me it is a bad idea.



More information about the Digitalmars-d mailing list