Skip to content
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

Checking for minimum/maximum number of native closure parameters #288

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Vankata453
Copy link

The sq_setparamscheck function, instead of accepting just the SQInteger nparamscheck parameter, now accepts both SQInteger nparamscheckmin and SQInteger nparamscheckmax.

Those define the minimum/maximum for the parameters number check policy. Setting any of them to 0 or negative disables the respective check.

I believe this change makes the parameter check way less restrictive and suitable for more use-cases. For example, it enables support for default arguments.


NOTE: This change makes changes to the API functions sq_setparamscheck and sq_getclosureinfo. I am not sure how Squirrel handles such changes (deprecation mechanic?). Because of this, I understand that this change might not be suitable for upstream.

The `sq_setparamscheck` function, instead of accepting just one `SQInteger nparamscheck` parameter, now accepts `SQInteger nparamscheckmin` and `SQInteger nparamscheckmax`.

Those define the minimum/maximum for the parameters number check policy. Setting any of them to 0 or negative disables the respective check.

This enables support for optional parameters.
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.

1 participant