[Ecls-list] Changes in unstable new_signals

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Tue Oct 21 21:49:53 UTC 2008


I have reimplemented lisp streams using the usual C object oriented
hack. Streams contain some common data and a vector to a dispatch
table for the most basic operations: binary I/O, character I/O,
sequence I/O, stream properties querying and setting, etc.

The first advantage of this interface is that we can now support
_both_ C streams and POSIX file descriptors. There are three functions
for building streams: ecl_make_stream_from_FILE,
ecl_make_stream_from_fd, and ecl_make_file_stream_from_fd, and three
new stream types, smm_io_file, smm_input_file and smm_output_file,
denoting that these are POSIX generalized files.

POSIX files are unbuffered: they rely entirely on the operating system
buffers and are more lightweight since they need no protection against
concurrent access by multiple threads. My experience so far has been
mixed: seems that the buffered I/O is better suited for text mode
operations and reading lisp sources, implying that the ANSI test suite
runs slightly slower when using these files. But I expect that they
should be useful for you to build more sophisticated streams on top of
them.

I am now heading towards UTF-8 input format. My take on this is _not_
to implement buffering at the level of unicode characters, but again
rely on the C streams for doing the buffered I/O. It should not be too
complicated then to just modify the read_char/write_char methods to
read and write multibyte characters.

BTW, the unstable source tree might not build on Windows, as I had to
strip off all the Windows socket code before cleaning up the streams
code. I hope to put everything back into place soon.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)
http://juanjose.garciaripoll.googlepages.com


More information about the ecl-devel mailing list