Open jjant opened 2 years ago
I'm guessing this https://rust-lang.github.io/rfcs/2137-variadic.html is unrelated as you can't specify the arguments? It's unstable anyway.
Is the purpose of the Option<T>
just to be able to put none without having to know the default for the specific variable? That doesn't sound bad if you wanted to make it as easy as possible, but since this is Rust people may as well just find out what their function is doing right?
I dislike exposing all versions as the naming is not going to be obvious, but having another print function that automatically adds 8 to y each time you call it would probably be really convenient as that removes some overhead.
Edit: https://pico-8.fandom.com/wiki/DrawState wiki says the cursor advances y by 8 pixels.
Description
Pico8 uses Lua as its scripting language, which allows overloading functions on the number of arguments it takes. For example, Pico8's
spr
function can be called in the following ways:We need to decide various things:
Option<T>
arguments and expose that instead:IMO that's pretty ugly, and not much more convenient than having non-optional arguments (and have the user pass in the defaults).
We need to make sure that whatever approach we choose works for all of the Pico8 API functions.