On Mar 22, 2015, at 7:42 PM, George Neuner <[email protected]> wrote:
> I thought about case-lambda, but it doesn't permit keywords like a > normal lambda. For that: http://pkg-build.racket-lang.org/doc/hash-lambda-toc/keyword-case-lambda.html Although I’m not sure how it would help for this case. > I've tried things like > (apply in-query (list* (list* dbc sql args) > (list (string->symbol "fetch") n))) > > to mimic the unwrapped call, but so far I've had no luck. Although it’s not really a good idea (see below), you might also be interested in: https://github.com/AlexKnauth/kw-utils/blob/master/kw-utils/kw-apply.rkt You would use it like this: (apply/kw in-query (list* dbc sql ‘#:fetch n args)) However, if any of the other arguments happen to be values representing keywords, it will either break or do something weird. Instead, a few better options: (apply in-query dbc sql #:fetch n args) Or, if you can’t do that because the keyword you need is a value determined at runtime: http://docs.racket-lang.org/reference/procedures.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._keyword-apply%29%29 (keyword-apply in-query ‘(#:fetch) (list n) dbc sql args) Or, if there might be multiple keywords and you don’t feel like sorting them yourself: http://pkg-build.racket-lang.org/doc/kw-utils/keyword-apply-sort_scrbl.html (keyword-apply/sort in-query ‘(#:fetch) (list n) dbc sql args) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

