From e51276baa1480dac0926380783b269c615f19850 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 7 Jun 2013 15:50:21 -0400 Subject: [PATCH] Flip order of actions to match paper draft --- marketplace/examples/chat-paper-raw.rkt | 14 +++++++------- marketplace/examples/chat-paper.rkt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) 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)