We have two different discussions going on here. One concerns keyword
arguments and the other concerns default arguments.

Keyword arguments, per se, only require one change to the language:
the formal parameter identifiers in a declaration must match the ones
in the implementation. There is also a slight change in the resolver
to make sure all arguments have been provided. That is all. This does
NOT involve any overloading or subtyping.

Default arguments are trickier. They actually do always have their
argument. The way to think about them is that they are closed over the
default values, and the keywords somehow bypass the encapsulation. I
suspect that this actually doesn't require subtyping, but can instead
be handled by constraints in a similar way to has-field. What you do
is type the function AS IF it had no default arguments at all, but add
a constraint on the type for each keyword argument. You decide
application-time type without regard to defaulted args, and then if
they are actually present (which is syntactically indicated by
keywords at the point of application) you use the constraint system.
It's all a bit weird, but I think it's probably doable.

All that having been said, we're not going to do it any time soon, if at all.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to