digitalmars.D - When will D get this feature?
- Benji Smith (3/3) Oct 07 2008 http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml
- KennyTM~ (7/12) Oct 07 2008 Because of the \ in the source code D can't parse this even if all the
- Jarrett Billingsley (3/16) Oct 07 2008 Erm, it is defined. See "escape strings" here:
- KennyTM~ (2/22) Oct 07 2008 Oh I see.
- Andrei Alexandrescu (6/30) Oct 07 2008 In wake of the recent comments on q{string}, I have the feeling this is
- Ary Borenszweig (3/33) Oct 07 2008 Who is using q{} and \n in real code? Why that was introduced? What was
- bearophile (4/6) Oct 07 2008 I don't understand the usefulness of \n instead of '\n', but I think the...
- Bill Baxter (6/45) Oct 07 2008 Tom S uses it in some of his code.
- KennyTM~ (3/35) Oct 07 2008 Hmm, sounds like there'll be lots of change after Templ{} and immutable ...
- Jarrett Billingsley (4/38) Oct 07 2008 FWIW I have *never* seen escape strings used. They are a complete
- Sergey Gromov (6/46) Oct 07 2008 I've got this in my code:
- David Wilson (8/17) Oct 07 2008 Agreed. Also, it encourages certain developers of a certain
http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benji
Oct 07 2008
Benji Smith wrote:http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
On Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
Jarrett Billingsley wrote:On Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
KennyTM~ wrote:Jarrett Billingsley wrote:In wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless. AndreiOn Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
Andrei Alexandrescu wrote:KennyTM~ wrote:Who is using q{} and \n in real code? Why that was introduced? What was the problem with normal string literals?Jarrett Billingsley wrote:In wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless.On Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
Ary Borenszweig:Who is using q{} and \n in real code? Why that was introduced? What was the problem with normal string literals?I don't understand the usefulness of \n instead of '\n', but I think the usefulness of q{} was to have a string that is ast-controlled that the editors don't color uniformly as a string. So I think \n can be removed, but q{} have a purpose, even if they may deserve a better syntax. Bye, bearophile
Oct 07 2008
Tom S uses it in some of his code. For making wysiwyg strings that have a newline at the end: string x = `This string is \wysiwyg\ but ends with newline`\n ; Course you could do that with "\n" instead of \n at the end, too. --bb On Wed, Oct 8, 2008 at 12:51 AM, Ary Borenszweig <ary esperanto.org.ar> wrote:Andrei Alexandrescu wrote:KennyTM~ wrote:Who is using q{} and \n in real code? Why that was introduced? What was the problem with normal string literals?Jarrett Billingsley wrote:In wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless.On Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
Andrei Alexandrescu wrote:KennyTM~ wrote:Hmm, sounds like there'll be lots of change after Templ{} and immutable :D I'd used `....`, but never q{...}Jarrett Billingsley wrote:In wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless. AndreiOn Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
On Tue, Oct 7, 2008 at 11:41 AM, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:KennyTM~ wrote:FWIW I have *never* seen escape strings used. They are a complete waste of a symbol, it seems.Jarrett Billingsley wrote:In wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless.On Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
Tue, 7 Oct 2008 12:29:35 -0400, Jarrett Billingsley wrote:On Tue, Oct 7, 2008 at 11:41 AM, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:I've got this in my code: // a newline sequence to be used for adding new lines, default is DOS char[] g_NewLine = \r\n; Not that it saves much typing.KennyTM~ wrote:FWIW I have *never* seen escape strings used. They are a complete waste of a symbol, it seems.Jarrett Billingsley wrote:In wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless.On Tue, Oct 7, 2008 at 9:56 AM, KennyTM~ <kennytm gmail.com> wrote:Oh I see.Benji Smith wrote:Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlhttp://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml ;-) --benjiBecause of the \ in the source code D can't parse this even if all the template stuffs are translated. Unless Walter clarifies what \ means outside a string (currently \n in the source code is directly translated to "\n". So writefln("Hello" \n "world"); is, em, valid.)
Oct 07 2008
2008/10/7 Andrei Alexandrescu <SeeWebsiteForEmail erdani.org>:Agreed. Also, it encourages certain developers of a certain alternative standard library / runtime to write things like "Hello, world!"\n which just looks like ass to me. :P Little 'cool' features like this can contribute to strange compile errors, or even potentially the hiding of real bugs (but don't press me for an example in this specific case) DavidIn wake of the recent comments on q{string}, I have the feeling this is a mistake of the same proportion as q{string}. It essentially hijacks "\" for pretty much all uses (lambdas were an idea) for the sake of a feature that is gratuitous and useless.Erm, it is defined. See "escape strings" here: http://www.digitalmars.com/d/1.0/lex.htmlOh I see.
Oct 07 2008