You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Many API functions have a lot of arguments and many have default values. Such as:
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)
, thecolor
andfixed
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?The text was updated successfully, but these errors were encountered: