Add quit-world action to chat.rkt

This commit is contained in:
Tony Garnock-Jones 2015-10-23 19:50:08 -04:00
parent d7095c9995
commit 974c21e5d0
1 changed files with 4 additions and 1 deletions

View File

@ -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)