From ddfa96d685fca0d0d18e1327a7a7fa791d54f8f9 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 30 Jul 2012 12:59:13 -0400 Subject: [PATCH] Inline "speaker" helper function --- chat-os2-paper.rkt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/chat-os2-paper.rkt b/chat-os2-paper.rkt index d66881f..9e29e32 100644 --- a/chat-os2-paper.rkt +++ b/chat-os2-paper.rkt @@ -34,11 +34,11 @@ (define (chat-roles me cout) (define (announce t did-what) - (unless (equal? (speaker t) me) + (define who (first (topic-pattern t))) + (unless (equal? who me) (at-meta-level (cout (term->bytes - `(,(speaker t) - ,did-what)))))) + `(,who ,did-what)))))) (list (role (topic-publisher `(,me says ,(wild)))) @@ -50,9 +50,6 @@ [msg (at-meta-level (cout (term->bytes msg)))]))) -(define (speaker t) - (first (topic-pattern t))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (net-roles me cin cout