Switch from co-role -> co-roles

This commit is contained in:
Tony Garnock-Jones 2012-03-14 15:38:08 -04:00
parent ffe06a65a8
commit ea2ff20dc6
2 changed files with 10 additions and 8 deletions

View File

@ -24,7 +24,7 @@
(struct-out topic)
topic-publisher
topic-subscriber
co-role
co-roles
co-topic
;; Reexported from unify.rkt for convenience
@ -245,20 +245,20 @@
(and es ;; some threads are not standard-threads
(exit-status-exception es)))
(define (co-role r)
(define (co-roles r)
(case r
[(publisher) 'subscriber]
[(subscriber) 'publisher]
[(publisher) '(subscriber)]
[(subscriber) '(publisher)]
[else #f]))
(define (co-topic t)
(struct-copy topic t [role (co-role (topic-role t))]))
(define (co-topic t new-role)
(struct-copy topic t [role new-role]))
(define (refine-topic remote-topic new-pattern)
(struct-copy topic remote-topic [pattern new-pattern]))
(define (roles-intersect? l r)
(eq? l (co-role r)))
(memq l (co-roles r)))
;; Both left and right must be canonicalized.
(define (topic-intersection left right)

View File

@ -57,7 +57,9 @@
[(says (and specific-topic (topic 'publisher _ _)) _)
(write `(,name acking) o)
(newline o)
(send handle say (co-topic specific-topic) (list name 'ack))]
(send handle say
(co-topic specific-topic 'subscriber)
(list name 'ack))]
[_ (void)])
(flush-output o)
(loop)))