Or even using (and/c ... (not/c hash-empty?)), which might get you better error messages.
Robby On Tue, Jun 13, 2017 at 10:55 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: > On Tue, Jun 13, 2017 at 9:08 AM, David Storrs <david.sto...@gmail.com> wrote: >> Thanks, Jon. >> >> On Mon, Jun 12, 2017 at 4:17 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: >>> >>> Predicates can be used as contracts, so: >>> >>> (define (non-empty-hash? x) >>> (and (hash? x) >>> (not (hash-empty? x)))) >>> >>> Then you can use `non-empty-hash?` as your contract. >>> > > I realized after the fact that you had asked about a > `non-empty-hashof` contract, not just a `non-empty-hash` one. > > You probably already did this, but just in case, here's one: > > (define (non-empty-hashof k v) > (and/c (hash/c k v) > (λ (x) (not (hash-empty? x))))) > > -- > 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. -- 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.