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

[Feature Request] Lua/Fennel using nil for default value #2720

Open
hw762 opened this issue Nov 29, 2024 · 0 comments
Open

[Feature Request] Lua/Fennel using nil for default value #2720

hw762 opened this issue Nov 29, 2024 · 0 comments

Comments

@hw762
Copy link

hw762 commented Nov 29, 2024

Many API functions have a lot of arguments and many have default values. Such as:

print(text, [x=0], [y=0], [color=15], [fixed=false], [scale=1], [smallfont=false]) -> text width

Unfortunately, it seems like Lua (and therefore Fennel) API fills in default values based on how many arguments are passed. So, if I do this: print(text, 0, 0, nil, nil, 2), the color and fixed variable will be incorrect.

Is it possible for the engine to check if each argument is nil and fill in the default value instead? Alternatively, is it possible to make it named arguments?

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

No branches or pull requests

1 participant