Updated examples to be compatible with new architecture.
[sam.git] / chat_client.scm
index 947418f..d500579 100644 (file)
@@ -1,5 +1,4 @@
-(import sam
-        matchable
+(import matchable
         srfi-13
         (chicken process-context))
 
 (define (main-beh self system)
   (send-message (make-actor (make-client-beh system)) 'start)
   'done)
-
-(define (print-usage)
-  (print "Actor-driven chat client.\n")
-  (print "Usage: chat_client -h")
-  (print "       chat_client [-p port_num] [-n host_name]"))
-
-(let loop ((args (cdr (argv)))
-           (host "localhost")
-           (port 8000))
-  (match args
-    (((or "-h" "--help"))
-     (print-usage))
-    (((or "-p" "--port") pstr rest ...)
-     (loop rest host (string->number pstr)))
-    (((or "-n" "--hostname") hstr rest ...)
-     (loop rest hstr port))
-    (()
-     (boot-sam host port main-beh))
-    (else
-     (print "Unrecognised argument '" (car args) "'.\n")
-     (print-usage))))
-