Adding Unicode operators to D

Steven Schveighoffer schveiguy at yahoo.com
Wed Oct 22 18:36:29 PDT 2008


"Andrei Alexandrescu"  wrote
> Correx:
>
> http://www.reddit.com/r/programming/comments/78rmc/allowing_unicode_operators_in_d_similarly_to/
>
> Andrei
>

No thanks.  Please let's only use operators that are on the keys of my 
keyboard. I don't fancy having to type key digraphs or trigraphs to try and 
write code.

I understand that others already have this problem, but I don't.  This would 
be a huge detractor from D for me.  I'd definitely support a language fork 
at that point, or at least refuse to deal with any code that has unicode 
operators.  I think you'd find others feel the same way.

Why can't the emacs module solution work that was used for the cheverons? 
That is, when emacs sees:

x opCross(y);

display it as

x x y

(of course, assume the middle x is the cross symbol, I have no idea how to 
type it).

And upon save, regenerate the correct code.

I see no issue with something like that.  This is all the compiler is doing 
anyways...

Note that any operators for unicode would be user-defined anyways, the 
standard operator symbols already cover what actually gets generated to 
machine code.  That is, unicode operator X is invariably going to map to 
opX, so there is no benefit to the compiler performing this step instead of 
an editor.

-Steve 




More information about the Digitalmars-d-announce mailing list