[Pre-RFC] named arguments

If we have that named arguments can be supplied either by-name or positionally, then I don’t think there’s anything wrong with saying that when you cast a function with named parameters to an fn or Fn type, you retain only the positional capability.

In other words:

  • If you give a function named parameters, you gain the ability to supply those arguments by-name instead of positionally.
  • This is strictly additive. You can still supply the arguments positionally just as before, and use the function in any other way you could have before.
  • This includes casting the function to an fn or Fn type, which are unchanged, and still only support positional parameters.

And then we can avoid opening a can of worms. If we decide that named parameters in fn and Fn types are something we want, we can always work on adding them separately, later.

3 Likes