Flip order of actions to match paper draft

This commit is contained in:
Tony Garnock-Jones 2013-06-07 15:50:21 -04:00
parent 960ad02762
commit e51276baa1
2 changed files with 9 additions and 9 deletions

View File

@ -37,12 +37,6 @@
(define (listen-to-user user them us) (define (listen-to-user user them us)
(list (list
(add-endpoint 'speech-publisher
(role 'publisher
`(,user says ,?)
'participant)
(lambda (event)
(lambda (state) (transition state '()))))
(at-meta-level (at-meta-level
(add-endpoint 'tcp-receiver (add-endpoint 'tcp-receiver
(role 'subscriber (role 'subscriber
@ -56,7 +50,13 @@
(lambda (state) (lambda (state)
(transition state (send-message `(,user says ,text) 'publisher)))] (transition state (send-message `(,user says ,text) 'publisher)))]
[_ [_
(lambda (state) (transition state '()))]))))) (lambda (state) (transition state '()))])))
(add-endpoint 'speech-publisher
(role 'publisher
`(,user says ,?)
'participant)
(lambda (event)
(lambda (state) (transition state '()))))))
(define (speak-to-user user them us) (define (speak-to-user user them us)
(define (say fmt . args) (define (say fmt . args)

View File

@ -17,13 +17,13 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (listen-to-user user them us) (define (listen-to-user user them us)
(list (list
(publish-on-topic `(,user says ,?))
(at-meta-level (at-meta-level
(subscribe-to-topic (tcp-channel them us ?) (subscribe-to-topic (tcp-channel them us ?)
(on-absence (quit)) (on-absence (quit))
(on-message (on-message
[(tcp-channel _ _ (? bytes? text)) [(tcp-channel _ _ (? bytes? text))
(send-message `(,user says ,text))]))))) (send-message `(,user says ,text))])))
(publish-on-topic `(,user says ,?))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (speak-to-user user them us) (define (speak-to-user user them us)