That will be exciting if a function has default arguments.
such as:
fn foo(bar string, count int =1) {
for _ in [..count] {
print(bar)
}
}
foo('hello') // -> hello
foo('hello', 3) // -> hellohellohello
Thankyou!
I'm new here, but this might go against the Safety Values
Safety
No null
No global variables
No undefined values
No undefined behavior
No variable shadowing
Bounds checking
Option/Result types
Generics
Immutable variables by default
Pure functions by default
Immutable structs by default
Having said this. I love and miss this feature from python. I would accept it in any language :+1:
V will have no function overloading/default arguments, but it will have
foo({bar:1})
where foo is fn foo(args struct {bar int, baz int = 10})
so baz is set to 10 by default
ok, got it!
Most helpful comment
V will have no function overloading/default arguments, but it will have
foo({bar:1})where
fooisfn foo(args struct {bar int, baz int = 10})so
bazis set to 10 by default