Re: [racket-users] Data contract for non-empty hash?

2017-06-13 Thread Robby Findler
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 wrote: > On Tue, Jun 13, 2017 at 9:08 AM, David Storrs wrote: >> Thanks, Jon. >> >> On Mon, Jun 12, 2017

Re: [racket-users] Data contract for non-empty hash?

2017-06-13 Thread David Storrs
Thanks, Jon. On Mon, Jun 12, 2017 at 4:17 PM, Jon Zeppieri 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. > > > > On Mon, Jun 12,

Re: [racket-users] Data contract for non-empty hash?

2017-06-12 Thread Jon Zeppieri
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. On Mon, Jun 12, 2017 at 3:56 PM, David Storrs wrote: > There is a non-empty-listof contract but no

[racket-users] Data contract for non-empty hash?

2017-06-12 Thread David Storrs
There is a non-empty-listof contract but no non-empty-hashof contract. Is there a way to build one? -- 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