X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=sam.git;a=blobdiff_plain;f=chat_client.scm;h=48736a8e684fc656d70bc94d271c22bb0d0f1e9c;hp=e12bc67847ac5844c6b0e0e0796fea5ddb121450;hb=7b73d44a72ed33304da016672c8f243a585856fa;hpb=98614aaf3ed99a4945600eadd08de9abaeade6be diff --git a/chat_client.scm b/chat_client.scm index e12bc67..48736a8 100644 --- a/chat_client.scm +++ b/chat_client.scm @@ -24,15 +24,12 @@ (let loop ((recipients-left recipients)) (unless (null? recipients-left) (send-message (car recipients-left) 'show-msg name str) - (loop (cdr recipients-left)))))) - (finally - 'sleep)))) + (loop (cdr recipients-left))))))))) (define (make-receiver-beh system) (make-beh (self) (('show-msg from text) => - (send-message system 'print from "> " text) - 'sleep))) + (send-message system 'print from "> " text)))) (define (make-client-beh system) @@ -43,7 +40,8 @@ (('start) => (send-message system 'print "Welcome to chat!\n" "Your client address is " (address->string receiver) ".\n" - "Type '/help' for a list of commands.\n")) + "Type '/help' for a list of commands.\n") + (send-message system 'read self)) (((? string? str)) => (if (string-prefix? "/" str) (let* ((maybe-idx (string-index str #\space)) @@ -76,11 +74,8 @@ (send-message system 'shutdown)) (else (send-message system 'print "Unrecognised command '" cmd "'")))) - (send-message rollodex 'send name str))) - - (finally - (send-message system 'read self) - 'sleep)))) + (send-message rollodex 'send name str)) + (send-message system 'read self))))) (define-beh main-beh (self) ((system) =>