[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 Don changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #6 from Don 2010-12-02 01:01:19 PST --- This bug report is actually asking for the non-parentheses template instantiation to be discarded entirely. It is a feature which relies 100% on the precedence rules. Remember that templates can have value parameters, so even something like: int y; auto x = to!Foo(y); can be considered to be ambiguous. Is it: to!(Foo)(y) or to!(Foo(y)) This applies to ALL function templates. The idea that there are a few "ambiguous cases" which could generate errors, is completely wrong. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 --- Comment #5 from Walter Bright 2010-12-01 22:16:09 PST --- (In reply to comment #3) > But I do. I know lots of people that have come to me with this problem, saying > it made them almost not use D. I'd like more information on this, please. There's been nothing on the ng. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 --- Comment #4 from bearophile_h...@eml.cc 2010-11-30 05:08:50 PST --- (In reply to comment #1) > I don't agree it is a source of confusion. I don't know anyone who has been > confused by it. Me! I'm the first then. (In reply to comment #2) > I should add that in cases like this, one should be able to document a trail > of > confusion, such as is well known with (a & b || c). The D2 template instantiation syntax is present in D2 only, and only for few months. So there is no 30 years old series of bug examples like the C syntax (a & b || c). Something similar is true for the new D2 operator syntax, that I think is bug-prone because it doesn't enforce statically only the allowed operators. So if you ask for a long trail of documented bugs you will need several years of D2 bugs, and then it may be too much late to fix D2 syntax. So my suggestion is to be more careful right now, because there is no better alternative. Here is some documentation, I have had a bug caused by the !x D2 template syntax in a program that defines a template linked list node: struct Node(T) { T data; Node!(T)* next; this(T data_, Node!(T)* next_=null) { data = data_; next = next_; } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 nfx...@gmail.com changed: What|Removed |Added CC||nfx...@gmail.com --- Comment #3 from nfx...@gmail.com 2010-11-30 00:56:14 PST --- (In reply to comment #1) > I don't agree it is a source of confusion. I don't know anyone who has been > confused by it. But I do. I know lots of people that have come to me with this problem, saying it made them almost not use D. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 --- Comment #2 from Walter Bright 2010-11-29 19:57:37 PST --- I should add that in cases like this, one should be able to document a trail of confusion, such as is well known with (a & b || c). The point of operator precedence is to avoid requiring parentheses everywhere, so a reasonably compelling case has to be presented to require them. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution||WONTFIX --- Comment #1 from Walter Bright 2010-11-29 19:53:38 PST --- I don't agree it is a source of confusion. I don't know anyone who has been confused by it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---