From 974c21e5d007130af20b24bd7b6e34e4a1562884 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 23 Oct 2015 19:50:08 -0400 Subject: [PATCH] Add quit-world action to chat.rkt --- prospect/examples/chat.rkt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prospect/examples/chat.rkt b/prospect/examples/chat.rkt index 9faacab..a60d81c 100644 --- a/prospect/examples/chat.rkt +++ b/prospect/examples/chat.rkt @@ -17,7 +17,10 @@ (lambda (e) (match e [(message (at-meta (tcp-channel _ _ bs))) - (message `(,user says ,(string-trim (bytes->string/utf-8 bs))))] + (define input-string (string-trim (bytes->string/utf-8 bs))) + (if (equal? input-string "quit-world") + (quit-world) + (message `(,user says ,input-string)))] [(message `(,who says ,what)) (say who "says: ~a" what)] [(? patch? p)