
Just finished a package for pass-through default values (wrapper functions) and simplifying keyword arguments: https://docs.racket-lang.org/define2/index.html It should have very little runtime overhead (if any).
Happy to receive feedback regarding names (is any chosen name ambiguous/bad to you?) or if something in the API should be enhanced

Thanks!

Using this package, I can finally finish a struct
form that uses keyword arguments for constructors and works with inheritance, here’s a test submodule:

I’m wondering if I should push this to the same define2
package, or a different package the depends on it.

I think I nailed the <https://docs.racket-lang.org/define2/index.html#%28form.%28%28lib.define2%2Fmain..rkt%29.~ce~bb%29%29|grammar for lambda> compared to the buggy one in the <https://docs.racket-lang.org/reference/lambda.html#%28form.%28%28lib.racket%2Fprivate%2Fbase..rkt%29.~ce~bb%29%29|main docs> :grin:

To avoid the two lines with/out . rest
, I wanted to write something like: args = (formals ...)
\| (formals ... . rest-id
formals ... = pos-id ... [opt-id opt-expr] ... kw-arg ...
but formals ...
is not permitted on the lhs :confused:

I could have written args = (formals)
\| (formals . rest-id)
formals = pos-id ... [opt-id opt-expr] ... kw-arg ...
but I felt it was harder to read

Your grammar is much more readable. Also, I think that being able to mix optional and mandatory arguments in the lambda can lead to confusion; having a specific order is nice.