As I sent earlier from my cell, I'm not convinced about keyword
arguments on procedures, but here is something mildly relevant:
It's sometimes useful to have a syntax for saying "copy that,
replacing these two fields with new values". Especially so in
functional style.
If we allow default values for fields in value constructors, we can do
something comparable to (ignoring syntax):
let x = {.foo = 3; .baz = 'c'}some_constructor(non-defaulted-args) in
...
With the intended meaning that {...} acts to filter its RHS.
This might achieve much of the benefit of keyword args in the case of
constructors without actually requiring them. It doesn't address the
issue of optional or keyword arguments for procedures.
On balance, I guess I've never found the use cases for keyword args
compelling. I see the case for default args, but doing that really
does require overloading on arity (which we currently could still do).
But there is also an open issue on default values: for concrete types
they are straightforward, but for parametric types how does one
express the desired default?
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev