Comma operator = broken design

Robert Jacques sandford at jhu.edu
Fri Dec 9 17:32:14 PST 2011


On Fri, 09 Dec 2011 00:27:39 -0500, so <so at so.so> wrote:
> On Fri, 09 Dec 2011 06:26:27 +0200, Robert Jacques <sandford at jhu.edu>
> wrote:
>
>>> So it clashes with another thing about D, pragmatism.
>> I'm not sure what you mean by that.
>
> It was/is one of the defining points of D AFAIK.
> More than being theoretical it chose to be pragmatic, to solve the
> problems we face day to day.
> For the case at hand; Say uninitialized variables in C are undefined but
> all the compilers do
> the same thing that makes it in practice defined. So the below line should
> execute same on all compilers.
>
> 	type a;
>
> Same applies to the extensions supported in all major compilers which is
> absent in language spec.
> If compilers don't support, they can't sell.
>
> To the point. If you want to keep B-D rule with the presence of such big
> design mistakes (C), you are not being pragmatic at all.

Interesting point. I agree with D being a very pragmatic language (it's one of my favorite things about it), but I come to a different conclusion. The ability to copy and paste code, i.e. source compatible, is one of the most pragmatic things a language can do. And, unlike C++, the B-D rule allows D to break compatibility and therefore convert design mistakes into invalid syntax. However, this is at the cost of preventing the invalidated syntax from being re-used for other means.


More information about the Digitalmars-d mailing list