https://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._flat-contract-with-explanation%29%29

says:

(flat-contract-with-explanation get-explanation   [#:name name])  →
flat-contract?
get-explanation : (-> any/c (or/c boolean? (-> blame? any)))
name : any/c = (object-name get-explanation)

When I try to create a contract that means "a list of length >= 2", I
get the following:

(flat-contract-with-explanation
  (lambda (l)
    (cond [(and (list? l) (>= (length l) 2))]
    [else
      (lambda (blame)
        (raise-blame-error blame l '(expected: "list with length >=
2"\ngiven: "~e" )))]))
         #:name 'foo)
; application: procedure does not accept keyword arguments
;   procedure: flat-contract-with-explanation

What am I not understanding?


PS:  I know I could do (-> (and/c list? (lambda (l) (>= (length l)
2)))) any) but I wanted to get something that wouldn't return ??? in
the error message

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