-
Notifications
You must be signed in to change notification settings - Fork 732
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
Pass nonmatching keyword args to the method call - doesNotUnderstand - Edit in PyrMessage.cpp (help) #6064
Comments
Just to be clear, the warning itself has nothing to do with But it seems like a very good idea, and very useful to have. Perhaps it is possible to have a special case in the case no selector is found, and call another method,
That method |
I've thought about this some more and the conversation over on scsynth was useful to, although the recommendation there was that this was a bad idea! I think the interface would have to be...
This way, on the stack you can push the receiver and selector, followed by two new arrays containing all the args. As I understand it... This line in cpp doesNotUnderstandWithKeys needs to be updated to call the new sc method, along with registering it in the global. Then the new stuff needs to be pushed on the stack. I don't know if this should overwrite the old stuff? In that function there is a large number of nested ifs ... I don't know what they do, but at the end it calls blockValueWithKeys. I think this is like exectueWithKeys, but on primitives? The final line of this function would then just call cpp executeMethod. supercollider/lang/LangSource/PyrMessage.cpp Line 761 in ef627ce
|
This is the optimisation for the You really should just need
But it isn't called by, e.g. So maybe someone who has a bit more knowledge about this part of the engine could chime in? |
Fixed by #6227 |
Looking for help solving an issue as it involves the lang code and I am struggling to understand it.
Motivation
For some class
prints
It would allow the creation of transparent wrapper classes if this would instead return
meaning you could call code before and after all methods.
I've written a little
Buffer
wrapper that tests to see if it has loaded on the server (and optional waits) before every method call, meaning the user never has to call s.sync again, it is completely transparent and works every where I have tested... except with named args method calls. This would be a huge simplification for the user.Plan for Implementation
I think the problem lies here:
supercollider/lang/LangSource/PyrMessage.cpp
Line 840 in ef627ce
and that the issue is simply a matter of copying all the arguments over.
This section...
supercollider/lang/LangSource/PyrMessage.cpp
Line 980 in ef627ce
...copies only the args that match the current argument names.
Is it possible to copy the rest that do not match over, but placed at the end of the list so it doesn't interfere with existing code?
I cannot seem to quite figure it out, is there any one who still understands this part of supercollider around?
There is one place where this will not work though, which is when the method arg name matches in doesNotUnderstand, e.g.,
prints
The other option would be to create a doesNotUnderstandWithKeys in the class library. There is a cpp function
doesNotUnderstandWithKeys
but no corresponding method inObject
- this is probably a bigger change though.I'm also gonna post this over on scsynth.
Thanks,
Jordan
The text was updated successfully, but these errors were encountered: