1 ;;;; This file was originally written by Peter Keller (psilord@cs.wisc.edu)
2 ;;;; and this code is released under the same license as IOLib.
4 (defpackage :iolib.examples
5 (:use
:cl
:iolib
:bordeaux-threads
)
8 (:export
:run-ex1-client
25 (in-package :iolib.examples
)
27 ;;;; This file also contains some simply utilities to help the writing of the
30 ;; The example host:port to which clients connect. Servers often bind to
31 ;; any interface, but listen on this port.
32 (defparameter *host
* "localhost")
33 (defparameter *port
* 9999)
35 ;; A simple, but efficient, queue implementation, used by some examples.
39 (defun enqueue (obj q
)
41 (setf (cdr q
) (setf (car q
) (list obj
)))
42 (setf (cdr (cdr q
)) (list obj
)
43 (cdr q
) (cdr (cdr q
))))
49 (defun empty-queue (q)