On 2016-01-04 01:49, Andrei Alexandrescu wrote:

Second, ET as a mechanism for SQL interface has other inherent
limitations. Consider the "LIKE" operator in SQL, which has no ET
equivalent in C++ with similar syntax, and no direct equivalent in LINQ.
That doesn't mean the respective languages are broken.

It's one operator that doesn't have a direct corresponding in the host language. With D, it's not possible to handle most of the operators.

Third, evaluating the merits and demerits of a language choice should be
done within several appropriate use cases, not just one. For example,
D's use of opEquals/opCmp saves a lot of boilerplate and potential bugs
in many cases compared to C++.

If D allowed to separately overload the comparison operators the standard library should of course provide a mixin of some kind to reduce the boilerplate.

On another example, C++'s overloading of
&&, ||, and the comma operator are considered downright disastrous and
are unrecommended by virtually all coding standards and guidelines, yet
do work with ETs.

I think for generating SQL, overloading && and || would be a valid use case.

There's of course AST macros as well, which have many other good use cases. Unfortunately you don't like those either :(

--
/Jacob Carlborg

Reply via email to