-
Notifications
You must be signed in to change notification settings - Fork 757
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
sclang: Ugen: composeBinaryOp add missing ^ #5000
sclang: Ugen: composeBinaryOp add missing ^ #5000
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite amazing that we haven't noticed this over such a long time. Could you post a test case?
Yes, I run into this with a custom class that defines isValidUGenInput to false. But we can do an example with Complex:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! can you please add a test?
cd2d0f8
to
e57c8b5
Compare
@brianlheim thanks for checking this out! Please let me know if you think it's ok enough, or if it would be appropriate to test the op's return values, or anything else really! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
thank you! |
Purpose and Motivation
UGen:composeBinaryOp checks if the other operand isValidUGenInput, and if not, calls
otherOperand.performBinaryOpOnUgen(this)
(pseudo). However, it doesn't return the latter's return value, making it ineffective.This has been like that since the dawn of time (+18 years?), however, all implementations of
performBinaryOpOnUgen
seem to expect their value to be returned:supercollider/SCClassLibrary/Common/Math/Complex.sc
Line 78 in f65a1ef
supercollider/SCClassLibrary/Common/Math/Polar.sc
Line 50 in f65a1ef
supercollider/SCClassLibrary/Common/Core/Object.sc
Line 683 in 9be3fe2
EDIT: another impementation found in Quarks
https://github.com/supercollider-quarks/downloaded-quarks/blob/3b0d2f1e405587613e3e5f43103184f231552c42/MathLib/classes/SpherCoords/Spherical.sc#L115
Types of changes
To-do list