-
- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Closed
Copy link
Description
I wanted to propose a very handy feature, overloading (also) based on named parameters. Basically this would compile:
proc foo(x : int) = echo "In foo1\n" proc foo(y : int) = echo "In foo2\n" foo(x = 2) # selects the first foo To my surprise, this minimal example already works. Could it be the feature is already there? However, nothing is currently publicly documented.
Perhaps there's fear that the language would feel too complex. But in this case, resolution based on argument names is very intuitive, both for learning the language and during reading the code. Keeping it out doesn't really help one to understand the other rules better.
So I suggest to make the feature visible.
andreaferretti, konradmb, Clyybber and awr1