The ability to create escape strings is a waste of the backslash character.
"hello world" \n
is not sufficiently superior to
"hello world\n"
Comment #1 by shro8822 — 2009-02-13T11:42:59Z
Try that again with several different \ things in the string. it quickly get unreadable.
Comment #2 by ary — 2009-02-13T11:55:47Z
Can you provide an example? Whenever I read a separated \n or \t it seems like it doesn't belong to the string and it confuses me, it makes it more unreadable.
Comment #3 by shro8822 — 2009-02-13T13:25:03Z
Just to clarify, I /don't/ like the suggestion.
Comment #4 by clugdbug — 2009-02-16T05:38:04Z
C has got by with it perfectly well for an awful long time.
Comment #5 by jarrett.billingsley — 2009-02-16T10:23:14Z
So has virtually every other language. I don't think I have *ever* seen the backslash string literals used in any D source. I doubt most people even know of their existence.
Comment #6 by shro8822 — 2009-02-16T13:12:48Z
I use them often when for literals of length 1. E.g.
return stringVar ~ \n;
Comment #7 by wbaxter — 2009-02-16T19:21:40Z
(In reply to comment #6)
> I use them often when for literals of length 1. E.g.
>
> return stringVar ~ \n;
That's no where near worth the price of giving up a whole symbol in my opinion.
But I think such a change should probably be bundled with an agreement on what to actually do with the freed up character. If the syntax is removed and D never does anything with it, then that's a waste. \n is not useless, it's just an underperforming use of \. What to do with it should be decided upon before giving it the axe. (lambdas were suggested somewhere).
Comment #8 by dfj1esp02 — 2009-02-18T05:11:22Z
I also don't like these escaped chars hanging around on their own.
Lambdas are expected to be just a minor syntax sugar for delegate literals: return statement and parameter types will be removed.
Comment #9 by bugzilla — 2009-02-20T21:17:57Z
It's a good idea to remove them. The feature didn't turn out to be interesting or useful, and it's time to clean out some detritus.