Open Nick-Mazuk opened 2 years ago
Lua functions can return multiple values without the callers having to consume them. It isn't a "tuple" in the C++ sense. It is two discrete values.
Is there a reason to think it would fail on Windows? It seems like bog-standard Lua to me.
When looking through the user settings source code, I noticed that the
get_parameters_from_file
usescalc_preferences_filepath
directly:https://github.com/finale-lua/lua-scripts/blob/c04293031839b6d18759f5d0035c7522c4466edd/src/library/configuration.lua#L268-L270
Yet
calc_preferences_filepath
returns a tuple:https://github.com/finale-lua/lua-scripts/blob/c04293031839b6d18759f5d0035c7522c4466edd/src/library/configuration.lua#L205-L222
This seems to be working fine on macOS, but it seems like a strong code smell. Is this working on Windows?
Either way, I'd suggest rewriting it to destructure the tuple first, then only use the first value. While this seems to be acceptable Lua code, this would not be acceptable code in many other languages and could confuse many other people (including me at first).