Subject: Re: Mixing text and binary data
From: (Rob Warnock)
Date: Sat, 01 Mar 2008 05:07:56 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
<> wrote:
| I would like to read/write both text and binary data on sockets and
| (*stdandard-input* *standard-output*).  Are there idioms in Lisp to
| mix text and binary ?

You've already gotten good answers from others, but just in case
you're using CMUCL, the implementation-specific way there is to
optional args to the OPEN (or WITH-OPEN-FILE). That will let
you do both text (e.g., READ-CHAR) and binary (e.g. READ-BYTE)
operations on the resulting stream.

In particular, my CMUCL "-script" hack uses it to allow "#!"
scripts of both source files and FASLs, see:


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607