Unicode operators and precedence?
Dominikus Dittes Scherkl
dominikus at scherkl.de
Sun Nov 1 19:47:33 UTC 2020
On Saturday, 31 October 2020 at 11:32:09 UTC, Ola Fosheim Grøstad
wrote:
> If D had more operators, specifically the ones in the Unicode
> spec. Which ones should be available and what would the
> precedence order be in relation to the existing ones?
>
> Suggestions:
>
> opUnary!"√"
This should also be binary (to calculate the n.th root, with n an
integer >= 2)
The priority should be rather high.
> opBinary!"·"
Don't we already have the dot operator (with much too many
meanings)?
If you mean some different character, I would recommend to
refrain from it as it is visual too similar.
> opBinary!"≈"
> opBinary!"≉"
> opBinary!"⊂"
> opBinary!"⊃"
> opBinary!"⊄"
> opBinary!"⊅"
> opBinary!"⊆"
> opBinary!"⊇"
> opBinary!"⊈"
> opBinary!"⊉"
> opBinary!"∈"
> opBinary!"∉"
All the comparison operators should have a very low priority,
equal to those of >, <, != etc.
> opBinary!"✕"
> opBinary!"⊗"
> opBinary!"⊘"
> opBinary!"⊙"
same as *, / ("point" arithmetic)
> opBinary!"⊕"
> opBinary!"⊖"
same as +, - ("stroke" arithmetic)
> opBinary!"∩"
> opBinary!"∪"
same as &, |, ^ ("set" arithmetic - bitwise is only a special
kind of set)
More information about the Digitalmars-d
mailing list