Another relation utility

This commit is contained in:
Tony Garnock-Jones 2012-03-22 04:48:49 -04:00
parent b3ecb43244
commit 7cf4c79757
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,7 @@
relation->hash relation->hash
in-relation-domain in-relation-domain
in-relation/grouped
relation-empty? relation-empty?
relation-count relation-count
@ -76,6 +77,9 @@
(define (in-relation-domain r) (define (in-relation-domain r)
(in-hash-keys (relation-table r))) (in-hash-keys (relation-table r)))
(define (in-relation/grouped r)
(in-hash (relation-table r)))
(define (relation-empty? r) (define (relation-empty? r)
(zero? (hash-count (relation-table r)))) (zero? (hash-count (relation-table r))))