Carpet

Carpet

2M Downloads

[suggestion] support optional argument in scarpet

aur3l14no opened this issue ยท 4 comments

commented

I don't know if there is a workaround currently. I believe it will save lots of duplicated codes.

commented

not really. You can however make, say 1 func which takes 5 args, then 1 which takes 4 args and executes the first with a predefines value for the 5th variable, and so on. Unlike in Java, you can't have 2 funcs with the same name.

commented

Don't see this being a problem, since you can submit args list as a list (one argument) or a map (named arguemnts)

but I can see this being added, just need to come up with a proper syntax for that. I would be part of adding command types for the better system commands support.

commented

The documentation has optional args in functions with a question mark, which seems pretty intuitive to me

commented

@SirGavith that is is in-built functions. This issue is about user-defined funcs, which are different