I think `keyword-apply` is what you want.

Sam

On Wed, Oct 26, 2016 at 2:11 PM, David Storrs <[email protected]> wrote:
> Is it possible to generate keywords for a call?
>
> For example, this works:
>
> (with-output-to-file
>   (buildpath "." "foo")
>   (lambda () (displayln "foooo!"))
>     #:mode 'text
>     #:exists 'replace)
>
> But this does not:
>
> (with-output-to-file
>   (buildpath "." "foo")
>   (lambda () (displayln "foooo!"))
>     #:mode 'text
>     (string->keyword "exists") 'replace)
>
> I ask because I'm interested in automating the production of structs
> from the murphy/protobuf library for purposes of testing.  It provides
> reflection usage so I can determine the fields and their types, but
> the structs are created using keywords.
>
> I'm guessing that this is a phase issue and I could do it with a macro
> at compile time but not a function at runtime.  Is that right?
>
> --
> 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.

-- 
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.

Reply via email to