Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support reverse binary operations #1

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

Open
wants to merge 1 commit into
base: feat/operator-overloads
Choose a base branch
from

Conversation

christabella
Copy link
Owner

What does this implement/fix? Explain your changes.

Reverse operator methods

Does this close any currently open issues?

...

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

Comment on lines +378 to +386
// Postprocessing to extend margs.
var margsTemp = new object[2];
// If forward, the bound instance is the left operand.
int boundOperandIndex = isForward ? 0 : 1;
// If forward, the passed instance is the right operand.
int passedOperandIndex = isForward ? 1 : 0;
margsTemp[boundOperandIndex] = co.inst;
margsTemp[passedOperandIndex] = margs[0];
margs = margsTemp;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about unary operators (e.g. -a, !a)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants