I'm still not sure that I understand what the original questioner is trying
to do. It might help to see an example in code to be clear that we're all
talking about the same thing.

A few points for the list, though:

On Fri, Aug 3, 2018 at 10:53 PM, George Neuner <gneun...@comcast.net> wrote:

>       (define mykey (make-parameter (string->keyword "#:unless")))
>

Using (string->keyword "#:unless") will produce the same keyword value as
(quote #:#:unless), which is *not* the same as the value of (quote
#:unless).


> One thing you might do is define the functions to take a plist "rest"
> argument, use ordinary symbols for keywords, and parse the arguments from
> the list.  …
>       (define (f x y . keys ) ... )
>       (f 1 2)
>       (f 1 2 'unless #t )
>

This is absolutely possible, but I would strongly advise against it.

You can call a function with dynamically calculated keyword arguments using
keyword-apply
<http://docs.racket-lang.org/reference/procedures.html?q=keyword-apply#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._keyword-apply%29%29>,
and you can create a function that accepts arbitrary or
dynamically-calculated keyword arguments (which is rarely desirable) using
make-keyword-procedure
<http://docs.racket-lang.org/reference/procedures.html?q=keyword-apply#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._make-keyword-procedure%29%29>.
These support essentially the same interface as an ad-hoc "keyword" system
using symbols, but take advantage of Racket's (current and future)
optimizations and features for keyword functions. Perhaps most importantly,
clients that *don't *need to dynamically calculate keywords can use the
normal calling conventions without having to worry about all this.

-Philip

-- 
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to