Am Mo., 16. März 2020 um 23:24 Uhr schrieb Lassi Kortela <
xxxxxx@lassi.io>:
> Sorry I hit the wrong button and sent an empty message.
No problem.
> That makes sense. And I can imagine it is doable to write a generic
> wrapper in macro domain,
> which is agnostic to whether the passed procedure takes keyword
> arguments or not, but
> I don't know enough about Racket how to write it.
When writing a macro, it's easiest to have it output an ordinary
procedure call with the keywords spliced in:
`(foo ,a-value ,b-value #:c ,c-value #:d ,d-value)
This might potentially cause surprises:
`(foo ,@some-values)
What is the value of `some-values'? Can you give an example where it causes surprises?
if some-values contains keyword objects. I've never thought about how
they handle that.
keyword-apply also lets you give constant keywords in the call itself,
in addition to the variable list of keywords passed to keyword-apply.