-
Notifications
You must be signed in to change notification settings - Fork 0
Description
What and why?
The suggestion is to add a big variety of optional operators that don't have to be implemented by default but can be used for additional features or user implemented features in context where some featur3es may be common but lack an operator, such as a dot product.
Concretely, the following operators could be implemented (shown with a "=" for readability, if applicable):
(if #23: overwritable) += -= *= /= \= ! ? <= >=
(if #23: overwritable) ++= --= !!= ??= **= //=
(implementable) <<= >>= \=
(implementable) @= #= $= %= ^= &= _= |= .= :=
(implementable) @@= ##= $$= %%= ^^= &&= __= ||= ..= ::=
as well as their (if #24 is implemented) approximated equivalent operators, which are defined seperately.
Notably, these would be implementable with different combinations of types, such as when multiplying a vector by a single number.
To be clear, with this suggestions, the existing operators could be implemented with multiple different signatures, almost like a method/function named after the operator.
Additionally, some new operators could optionally be implemented, such as, per my suggestion:
~? ~! to compare by reference address, instead of true data equality, unless overwritten, contrasting ? and ! for value comparisons.
^= to exponentiate
|= to calculate a logarithm
#= to calculate a root
\= to calculate the non negative modulo ( mod(mod(x,n)+n,n) )
<<= to get the smaller (minimum) value
= to get the bigger (maximum) value
as well as the according approximation variants (if #24 is implemented).