-
Notifications
You must be signed in to change notification settings - Fork 29
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
Force game functions var args #220
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.
In conjunction with this PR, the changes seem to have fixed the erroneous behavior for "my room". Thanks for the PR!
Will leave it to the modules team to approve & merge just in case.
Before we go ahead with this, I do think it is worth looking into why the varargs problem exists, and what we can do to fix it for all modules without having to monkey patch things. Unless this is really urgent in which case we can move forward with it first. |
I do agree - we'll only need this by week 7, so there is some time to do something more comprehensive. As far as I can tell, there seems to be no good way to get information about default parameters from a Function object. So, the arity checks in js-slang will require exactly the number of required parameters to be provided: For some context, I think module varargs used to work properly (?) long ago (probably before checks of this kind were introduced with rest/spread). When things broke, it started requiring all arguments (including those with default values) - I don't have much insight as to why. It now seems like that behavior has changed and exactly the required arguments must be provided. |
I think we can move forward with solving the room issue and at the same time keep a general solution in mind, using a new Issue. |
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.
OK, as discussed in telegram group "SA 2425 Game".
Description
Module function var-args has been broken for awhile. Let's add a quick fix by injecting game functions
minArgsNeeded
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Load modules and check that var args are allowed
Checklist: