Re: double - double[]... | feature or bug?

2010-12-24 Thread bearophile
Steven Schveighoffer: This feature brings absolutely nothing to the table IMO. Added as issue 5368. Bye, bearophile

Re: double - double[]... | feature or bug?

2010-12-23 Thread spir
On Thu, 23 Dec 2010 00:34:41 -0600 Christopher Nicholson-Sauls ibisbase...@gmail.com wrote: On 12/22/10 15:06, Andrej Mitrovic wrote: Oooh. That cought me off guard, sorry. Thanks Steve. I'll concede that the syntax can be odd at first, but it also enables some interesting things.

Re: double - double[]... | feature or bug?

2010-12-23 Thread bearophile
spir: While I understand some may consider this a nice feature, for me this is an enormous bug. A great way toward code obfuscation. I like D among other reasons because it's rather clear compared to other languages of the family. The main problem here is that I have never felt the need of

Re: double - double[]... | feature or bug?

2010-12-23 Thread Andrej Mitrovic
On 12/23/10, bearophile bearophileh...@lycos.com wrote: spir: While I understand some may consider this a nice feature, for me this is an enormous bug. A great way toward code obfuscation. I like D among other reasons because it's rather clear compared to other languages of the family. The

Re: double - double[]... | feature or bug?

2010-12-23 Thread Don
bearophile wrote: spir: While I understand some may consider this a nice feature, for me this is an enormous bug. A great way toward code obfuscation. I like D among other reasons because it's rather clear compared to other languages of the family. The main problem here is that I have

Re: double - double[]... | feature or bug?

2010-12-23 Thread Steven Schveighoffer
On Thu, 23 Dec 2010 12:34:45 -0500, Don nos...@nospam.com wrote: bearophile wrote: spir: While I understand some may consider this a nice feature, for me this is an enormous bug. A great way toward code obfuscation. I like D among other reasons because it's rather clear compared to other

double - double[]... | feature or bug?

2010-12-22 Thread Andrej Mitrovic
DMD 2.051 with -unittest: import std.algorithm, std.range, std.stdio : writeln; void main() {} void average(double[]) { writeln(non-variadic); } void average(double[]...) { writeln(variadic); } unittest { average(1.5); // writes variadic }

Re: double - double[]... | feature or bug?

2010-12-22 Thread Jonathan M Davis
On Wednesday, December 22, 2010 12:05:18 Andrej Mitrovic wrote: DMD 2.051 with -unittest: import std.algorithm, std.range, std.stdio : writeln; void main() {} void average(double[]) { writeln(non-variadic); } void average(double[]...) { writeln(variadic); } unittest {

Re: double - double[]... | feature or bug?

2010-12-22 Thread Andrej Mitrovic
I thought the variadic version would only take this type: average([1.5], [2.5]); So a variable number of *array* of doubles, not a variable number of doubles. On 12/22/10, Jonathan M Davis jmdavisp...@gmx.com wrote: On Wednesday, December 22, 2010 12:05:18 Andrej Mitrovic wrote: DMD 2.051

Re: double - double[]... | feature or bug?

2010-12-22 Thread Steven Schveighoffer
On Wed, 22 Dec 2010 15:46:01 -0500, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: I thought the variadic version would only take this type: average([1.5], [2.5]); So a variable number of *array* of doubles, not a variable number of doubles. No, that's not it. T[] arg... is a

Re: double - double[]... | feature or bug?

2010-12-22 Thread Andrej Mitrovic
Oooh. That cought me off guard, sorry. Thanks Steve. On 12/22/10, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 22 Dec 2010 15:46:01 -0500, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: I thought the variadic version would only take this type: average([1.5], [2.5]); So a

Re: double - double[]... | feature or bug?

2010-12-22 Thread Christopher Nicholson-Sauls
On 12/22/10 15:06, Andrej Mitrovic wrote: Oooh. That cought me off guard, sorry. Thanks Steve. I'll concede that the syntax can be odd at first, but it also enables some interesting things. For example, this works: class Foo { this (int i, double f) { /*...*/ } /*...*/ } void