digitalmars.D - Syntax changing
- Monkol (3/3) Jun 02 2011 i think it is necessary to change template syntax and do as C++ style
- Steven Schveighoffer (5/8) Jun 02 2011 If this is a legitimate request, and not trolling, this design change wa...
- Nick Sabalausky (4/7) Jun 02 2011 I came from C++, and I found it easy to adapt. Plus, like it says in the...
- Jonathan M Davis (12/21) Jun 02 2011 LOL. I use C++ in my job, but I use templates in D so much more than I d...
-
Monkol
(4/31)
Jun 05 2011
the statement to
is more easy readable then - Nick Sabalausky (4/38) Jun 05 2011 I find to!float("123e2") more readable. And once again, "like it says in...
- Andrei Alexandrescu (3/37) Jun 05 2011 Except you ironically got the easily readable syntax wrong...
-
David Nadlinger
(10/12)
Jun 05 2011
(You probably meant »to
("123e2")«). - Mehrdad (4/15) Jun 05 2011 It's not just a "looks" issue. Doing that would no longer allow the
- so (6/41) Jun 06 2011 No it is not, but if you were talking about templates arguments rather
i think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and it will be easy to adapt.
Jun 02 2011
On Thu, 02 Jun 2011 16:15:24 -0400, Monkol <dj_mon mail.ru> wrote:i think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and it will be easy to adapt.If this is a legitimate request, and not trolling, this design change was on purpose: http://www.digitalmars.com/d/2.0/templates-revisited.html -Steve
Jun 02 2011
"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...i think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and it will be easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 02 2011
On 2011-06-02 13:56, Nick Sabalausky wrote:"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...LOL. I use C++ in my job, but I use templates in D so much more than I do in C++ that I now end up using !() instead of <> unless I catch myself. I actually ultimately much prefer !() - especially since you can reduce it to just ! when there's only one template argument and it doesn't have any periods in it. Though honestly, if a programmer can't get used to a slightly different syntax, then they're screwed anyway. Every language has its quirks and differences. Syntax is a very small part of all of that. Really, the syntax is the _easy_ part. It's the semantics where the real problems start as far as adapting to a new language goes. - Jonathan M Davisi think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and it will be easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 02 2011
On Fri, 03 Jun 2011 00:36:42 +0300, Jonathan M Davis <jmdavisProg gmx.com> wrote:On 2011-06-02 13:56, Nick Sabalausky wrote:the statement to<float("123e2")> is more easy readable then to!float("123e2") for example"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...LOL. I use C++ in my job, but I use templates in D so much more than I do in C++ that I now end up using !() instead of <> unless I catch myself. I actually ultimately much prefer !() - especially since you can reduce it to just ! when there's only one template argument and it doesn't have any periods in it. Though honestly, if a programmer can't get used to a slightly different syntax, then they're screwed anyway. Every language has its quirks and differences. Syntax is a very small part of all of that. Really, the syntax is the _easy_ part. It's the semantics where the real problems start as far as adapting to a new language goes. - Jonathan M Davisi think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and itwillbe easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 05 2011
"Monkol" <dj_mon mail.ru> wrote in message news:op.vwmftxtmcqe400 pc-2010.dnepr.net.ua...On Fri, 03 Jun 2011 00:36:42 +0300, Jonathan M Davis <jmdavisProg gmx.com> wrote:I find to!float("123e2") more readable. And once again, "like it says in the link Steve gave, there are technical downsides to using <>".On 2011-06-02 13:56, Nick Sabalausky wrote:the statement to<float("123e2")> is more easy readable then to!float("123e2") for example"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...LOL. I use C++ in my job, but I use templates in D so much more than I do in C++ that I now end up using !() instead of <> unless I catch myself. I actually ultimately much prefer !() - especially since you can reduce it to just ! when there's only one template argument and it doesn't have any periods in it. Though honestly, if a programmer can't get used to a slightly different syntax, then they're screwed anyway. Every language has its quirks and differences. Syntax is a very small part of all of that. Really, the syntax is the _easy_ part. It's the semantics where the real problems start as far as adapting to a new language goes. - Jonathan M Davisi think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and itwillbe easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 05 2011
On 06/05/2011 04:11 PM, Monkol wrote:On Fri, 03 Jun 2011 00:36:42 +0300, Jonathan M Davis <jmdavisProg gmx.com> wrote:Except you ironically got the easily readable syntax wrong... AndreiOn 2011-06-02 13:56, Nick Sabalausky wrote:the statement to<float("123e2")> is more easy readable then to!float("123e2") for example"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...LOL. I use C++ in my job, but I use templates in D so much more than I do in C++ that I now end up using !() instead of <> unless I catch myself. I actually ultimately much prefer !() - especially since you can reduce it to just ! when there's only one template argument and it doesn't have any periods in it. Though honestly, if a programmer can't get used to a slightly different syntax, then they're screwed anyway. Every language has its quirks and differences. Syntax is a very small part of all of that. Really, the syntax is the _easy_ part. It's the semantics where the real problems start as far as adapting to a new language goes. - Jonathan M Davisi think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and itwillbe easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 05 2011
On 6/5/11 11:11 PM, Monkol wrote:the statement to<float("123e2")> is more easy readable then to!float("123e2") for example(You probably meant »to<float>("123e2")«). That's purely subjective (and, by the way, I don't agree with your assertion), while there are objective downsides to using angled brackets – they are ambiguous with the <, >, and >> operators. For example, consider the following pieces of C++ code: »foo<bar<16>>2>>« or just »foo<bar>>« Do you see the ambiguity created here? D doesn't suffer from this problem, since ! is never used as a binary operator. David
Jun 05 2011
It's not just a "looks" issue. Doing that would no longer allow the language to be context-free, because of ambiguities with greater-than/less-than operators. http://stackoverflow.com/questions/52506/c-template-ambiguity"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...i think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ andit willbe easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 05 2011
On Mon, 06 Jun 2011 00:11:47 +0300, Monkol <dj_mon mail.ru> wrote:On Fri, 03 Jun 2011 00:36:42 +0300, Jonathan M Davis <jmdavisProg gmx.com> wrote:No it is not, but if you were talking about templates arguments rather than single argument, you'd have your case. fun!(T1, T2, ... TN)(A1, A2, ... AN); vs fun<T1, T2, ... TN>(A1, A2, ... AN);On 2011-06-02 13:56, Nick Sabalausky wrote:the statement to<float("123e2")> is more easy readable then to!float("123e2") for example"Monkol" <dj_mon mail.ru> wrote in message news:op.vwgs7ypjcqe400 pc-2010.dnepr.net.ua...LOL. I use C++ in my job, but I use templates in D so much more than I do in C++ that I now end up using !() instead of <> unless I catch myself. I actually ultimately much prefer !() - especially since you can reduce it to just ! when there's only one template argument and it doesn't have any periods in it. Though honestly, if a programmer can't get used to a slightly different syntax, then they're screwed anyway. Every language has its quirks and differences. Syntax is a very small part of all of that. Really, the syntax is the _easy_ part. It's the semantics where the real problems start as far as adapting to a new language goes. - Jonathan M Davisi think it is necessary to change template syntax and do as C++ style template A <>, and not A !(), A <>. many people come from C++ and itwillbe easy to adapt.I came from C++, and I found it easy to adapt. Plus, like it says in the link Steve gave, there are technical downsides to using <>.
Jun 06 2011