Re: [racket-users] [racket users] Contracts and make-keyword-procedure question

2019-08-24 Thread Ben Greenman
The -> combinator doesn't support unspecified keywords. ->* won't work either.

Instead, you can try writing a new contract combinator (keyword-procedure/c ?)

Or, don't use define/contract and put the domain checks in the function body.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAFUu9R4P2MS7qeBgdUcsW5FPpHLcKp%3Dqj6DZ2RjsWaiQKf%2BFYA%40mail.gmail.com.


[racket-users] [racket users] Contracts and make-keyword-procedure question

2019-08-23 Thread Kevin Forchione
Suppose I have the following:

(define/contract foo (-> ??? any/c symbol? symbol? any/c any)
   (make-keyword-procedure (lambda (kw kv a b . args) do-something …)))

What sort of contract would I give to the kw parameter so that it basically 
accepts a list of unspecified keywords? What I’m doing is passing that 
information along to keyword-apply and the function derived from other argument 
data. I’d like to be able to skip the contract on the keywords at the moment, 
and simply enforce the other arguments. 

What I get is an error message that would say that foo expects no keywords, but 
was supplied them, as might be the case, even with any/c specified. 

Any suggestions are appreciated.

Kevin

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6AA60DD2-7A42-4527-AED7-4A51FF0146B8%40gmail.com.