diff --git a/marketplace/examples/chat-paper-raw.rkt b/marketplace/examples/chat-paper-raw.rkt index e40ade2..b2fb6b4 100644 --- a/marketplace/examples/chat-paper-raw.rkt +++ b/marketplace/examples/chat-paper-raw.rkt @@ -37,12 +37,6 @@ (define (listen-to-user user them us) (list - (add-endpoint 'speech-publisher - (role 'publisher - `(,user says ,?) - 'participant) - (lambda (event) - (lambda (state) (transition state '())))) (at-meta-level (add-endpoint 'tcp-receiver (role 'subscriber @@ -56,7 +50,13 @@ (lambda (state) (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 (say fmt . args) diff --git a/marketplace/examples/chat-paper.rkt b/marketplace/examples/chat-paper.rkt index 5e18125..197c50c 100644 --- a/marketplace/examples/chat-paper.rkt +++ b/marketplace/examples/chat-paper.rkt @@ -17,13 +17,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (listen-to-user user them us) (list - (publish-on-topic `(,user says ,?)) (at-meta-level (subscribe-to-topic (tcp-channel them us ?) (on-absence (quit)) (on-message [(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)