bearophile wrote:
Andrei Alexandrescu:

* Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this:

T opBinary(string op)(T rhs) { ... }

The string is "+", "*", etc.

I thought the problem with this was that the lexer/parser would have to know about semantics, which is against the goals of the language. Would the operator actually be inside quotes?

Anyway, do we _really_ want to make it possible, that valid D code will look like ASCII art?

Reply via email to