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.
}
a function
func f(string a, {string b}) -> voidcan be called likef("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 argumentsf("a", b="b")or with b left undefinedf("a")in which casebwould fall back to the previously defined default"default_b"this is useful e.g. for simple numeric defaults: