Skip to content

Commit

Permalink
0.8alpha.0.27:
Browse files Browse the repository at this point in the history
	Add skeletal simple-streams contrib from Rudi Schlatte, based on Paul
	Foley's implementation for CMUCL.
  • Loading branch information
csrhodes committed May 13, 2003
1 parent 541c939 commit ac85367
Show file tree
Hide file tree
Showing 16 changed files with 3,394 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Expand Up @@ -1711,6 +1711,9 @@ changes in sbcl-0.8alpha.0 relative to sbcl-0.7.14
changes in sbcl-0.8.0 relative to sbcl-0.8alpha.0
* SBCL now builds using CLISP (version of late April 2003 from CVS)
as cross-compilation host.
* a contributed module containing a partial implementation of the
simple-streams interface has been included. (thanks to Rudi
Schlatte)
* minor incompatible change: the :NEGATIVE-ZERO-IS-NOT-ZERO feature
no longer has any effect, as the code controlled by this feature
has been deleted. (As far as we know, no-one has ever built using
Expand Down
2 changes: 2 additions & 0 deletions contrib/sb-simple-streams/Makefile
@@ -0,0 +1,2 @@
SYSTEM=sb-simple-streams
include ../asdf-module.mk
57 changes: 57 additions & 0 deletions contrib/sb-simple-streams/README
@@ -0,0 +1,57 @@
-*- text -*-

An implementation of simple streams for sbcl.

Simple streams are an extensible streams protocol, with similar goals
but different architecture than Gray streams. Documentation about
simple streams is available at
http://www.franz.com/support/documentation/6.2/doc/streams.htm

This code was originally written by Paul Foley for cmucl; Paul's
version resides (as of 2003-05-12) at
http://users.actrix.co.nz/mycroft/cl.html

The port to sbcl was done by Rudi Schlatte (rudi@constantly.at). Bug
reports welcome.

==================================================

Some sketchy notes about the simple-streams architecture, at least
partly for my own benefit

(For all the details, please see Franz' documentation)

Motivation:

If you want to extend a given Gray stream, is it enough to supply a
method for stream-write-byte, or do you have to overwrite
stream-write-sequence as well? How do you extend your Gray socket
stream to support chunked stream encoding for HTTP/1.1? Chances are
that for any seriously interesting stream customization, you will
implement some kind of buffer, collect data in it and



Simple streams is a layered architecture. The device layer at the
bottom deals with transferring chunks of bytes between a buffer and a
device (socket, file, printer, what-have-you). The top layer is the
familiar CL API (read-line, write-sequence, open, etc). The strategy
layer in the middle translates between the buffer-of-bytes and CL
stream world-view, dealing with byte<->character conversion,
line-ending and stream-external-format conventions, etc.

Implementing a new type of stream is a matter of extending the right
stream class and implementing device-read, device-write, device-extend
& friends. single-channel-simple-stream is a class where there is one
buffer for both input and output (this is appropriate e.g. for a file). The
dual-channel-simple-stream class deals with devices that require
separate buffers for input and output (e.g. sockets).

Other character representations (Unicode, other multi-byte encodings)
are implemented at the strategy level. The Franz documentation is
unclear about this, but it seems that encodings take an active part
("the encoding reads as many bytes as are necessary to compose a
character", or words to that effect). This is not implemented in the
present code (neither is it in Paul Foley's implementation), and will
not be until sbcl gains Unicode abilities, but it would be nice to
have it at least stubbed out in the implementation.

0 comments on commit ac85367

Please sign in to comment.