From: Matthias Buelow
Subject: multiplexing stream input
Date: 
Message-ID: <ye0pv9veim0.fsf@utopia.informatik.uni-wuerzburg.de>
Hi folks,

I need to do something with Common Lisp streams what the select()
system call does on Unix systems - that is, generally speaking,
take a couple of streams, and wait for any of them to have new
data so that I can parse input from several streams at once (the
streams are CLISP socket connections and *standard-input*).

I've tried to use a concatenated stream but with little success;
the concatenated-stream-streams function together with listen
does pretty much what I want but it doesn't wait; waiting with
read-char on the concatenated stream is also unsatisfying; with
unread-char on the concat stream (which would be an ugly kludge
in this situation), the character is not readable anymore from
the constituent stream where it was taken from.

Is there any way to do such a thing in a plain Common Lisp manner
(it should run on clisp and cmucl at least)?

-- 
  Matthias K. Buelow      * Boycott Micro$oft, see http://www.vcnet.com/bms/ *

From: John Atwood
Subject: Re: multiplexing stream input
Date: 
Message-ID: <74hooo$j7d$1@news.NERO.NET>
does the listen function do what you want?
http://www.harlequin.com/education/books/HyperSpec/Body/fun_listen.html



John Atwood
From: Matthias Buelow
Subject: Re: multiplexing stream input
Date: 
Message-ID: <873e6rh5iq.fsf@altair.mayn.de>
·······@bronze.CS.ORST.EDU (John Atwood) writes:

> does the listen function do what you want?
> http://www.harlequin.com/education/books/HyperSpec/Body/fun_listen.html

Nope, unfortunately not.  I have already considered (and used) listen
in this context, but it does not wait, and it checks only one stream
at once.

-- 
  ``Round about the terminal go; / In the poisoned upgrade throw.
  Code, which by a student done / In minutes numbering sixty-one.
  Run-time error, protection fault / Crash ye first, crash ye shalt.''
	(The Oracle, MacBeth95)
From: Mike McDonald
Subject: Re: multiplexing stream input
Date: 
Message-ID: <74hpi0$p4l$1@spitting-spider.aracnet.com>
In article <···············@utopia.informatik.uni-wuerzburg.de>,
	·····@cip.informatik.uni-wuerzburg.de (Matthias Buelow) writes:

> Is there any way to do such a thing in a plain Common Lisp manner
> (it should run on clisp and cmucl at least)?

  None that I've ever found. When I complained about it years ago, I was told
that was an OS function and didn't belong in CL. :-( I do believe that both
CLisp and CMUCL have extensions that allow you to do it though.

  Mike McDonald
  ·······@mikemac.com