-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The *=
operator ought to act on the left
#5
Comments
Since Asymptote is a C-like language, we follow the usual convention that self operators apply the right operand on the
to produce
not
|
For the That having been said, the C++ eigen library choose the same convention you do:
Since they feel the need to explicitly document this, they presumably foresaw that at least some users would not find this obvious. But if the goal is to respect existing conventions, what evidence there is seems to be on your side. |
Currently, operators followed by an equals sign always act on the right. For instance,
a /= b;
is equivalent toa = a / b;
, with theb
on the right. This is essential for some operators (-
,/
,%
) and fine for others (+
,^
), but it's the wrong thing to do for the*
operator because when*
is noncommutative, the action is generally on the left. For instance, the following line ought to work but currently doesn't:The text was updated successfully, but these errors were encountered: