| ▲ | hiccuphippo 2 hours ago | ||||||||||||||||
I see it this way, the full signature for defining a variable is:
There's two ways to shorten it:
It can infer the type of the var from the right hand side; or the type of the right side from the type of the var.So when you see .{} as an argument, it is inferring the type from the function signature. It happens to be empty only because it's using default values (or is a tuple with 0 items). Edit: fixed the extra dots. | |||||||||||||||||
| ▲ | dnautics 2 hours ago | parent [-] | ||||||||||||||||
that's not quite right. 1) It's var foo = Foo{...}; (no intervening dot) 2) I think parent commenter is referring to function call use case call_my_func(.{...}) | |||||||||||||||||
| |||||||||||||||||