-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
a function func f(string a, {string b}) -> void can be called like f("a", b="b"), but in every case, all kwargs have to be defined.
I propose something like func f(string a, {string b="default_b"}) -> void, after which you can call the function with all arguments f("a", b="b") or with b left undefined f("a") in which case b would fall back to the previously defined default "default_b"
this is useful e.g. for simple numeric defaults:
func log(int x, {int base=e}){
# logarithm function that optionally takes a kwarg for its base, and otherwise does a natural logarithm.
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request