Package trivial-gray-streams
trivial-gray-streams provides an extremely thin compatibility layer for
gray streams. It is nearly "too" trivial for a complete package, except that
the author David Lichteblau has copy and pasted this code into enough projects
now that he decided to factor it out once again now, and then "never" has to
touch it again.
This interface was proposed for inclusion with ANSI CL by David N. Gray in Issue STREAM-DEFINITION-BY-USER. The proposal did not make it into ANSI CL, but most popular CL implementations implement this facility anyway. The documentation of this proposal is included in this documentation.
This interface was proposed for inclusion with ANSI CL by David N. Gray in Issue STREAM-DEFINITION-BY-USER. The proposal did not make it into ANSI CL, but most popular CL implementations implement this facility anyway. The documentation of this proposal is included in this documentation.
About This PackageLicense How to use it Problem description Overview Classes Character input Character output Other functions Binary streams Extensions Examples OverviewAuthorCopyright (c) 2005 David LichteblauVersionThe Library has no version information.Homepagehttp://common-lisp.net/project/trivial-gray-streams/Mailing ListSend bug reports to http://lists.common-lisp.net/mailman/listinfo/trivial-gray-streams-develDownloadThe library is available via Quicklisp.A snapshot tarball is available from https://gitorious.org/trivial-gray-streams/trivial-gray-streams/archive-tarball/master Source CodeThe Git repository is https://gitorious.org/trivial-gray-streams/trivial-gray-streamsDocumentationThis documentation is generated with a fork of atdoc. The documentation tries to summarize available informations about the package trivial-gray-streams.Dependenciestrivial-gray-streams does not depend on other libraries.LicenseCopyright (c) 2005 David LichteblauPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. How to use it
Problem descriptionCommon Lisp does not provide a standard way for users to define their own streams for use by the standard I/O functions. This impedes the development of window systems for Common Lisp because, while there are standard Common Lisp I/O functions and there are beginning to be standard window systems, there is no portable way to connect them together to make a portable Common Lisp window system.There are also many applications where users might want to define their own filter streams for doing things like printer device control, report formatting, character code translation, or encryption/decryption. OverviewDefine a set of generic functions for performing I/O. These functions will have methods that specialize on the stream argument; they would be used by the existing I/O functions. Users could write additional methods for them in order to support their own stream classes.Define a set of classes to be used as the superclass of a stream class in order to provide some default methods. ClassesThe following classes are to be used as super classes of user-defined stream classes. They are not intended to be directly instantiated; they just provide places to hang default methods.
The base class for all Gray Streams. ...
A superclass of all Gray input streams. ...
A superclass of all Gray output streams. ...
A superclass of all Gray streams whose element-type is a subtype of
character. ...
A superclass of all Gray streams whose element-type is a subtype of
unsigned-byte or signed-byte ...
A superclass of all Gray input streams whose element-type is a subtype of
character. ...
A superclass of all Gray output streams whose element-type is a subtype of
character. ...
A superclass of all Gray input streams whose element-type is a subtype of
unsigned-byte or signed-byte ...
A superclass of all Gray output streams whose element-type is a subtype of
unsigned-byte or signed-byte. ... Character inputA character input stream can be created by defining a class that includes fundamental-character-input-stream and defining methods for the generic functions below. This reads one character from the stream. ... This is used to implement cl:read-char-no-hang. ... Used by cl:listen. ... Used by cl:read-line. ... Character outputA character output stream can be created by defining a class that includes fundamental-character-output-stream and defining methods for the generic functions below.
This function returns the column number where the next character will be written, or nil if that is not meaningful for this stream. ... This is a predicate which returns t if the stream is positioned at the beginning of a line, else nil. ... This is used by cl:write-string. ... Writes an end of line, as for cl:terpri. ... Outputs a new line to the stream if it is not positioned at the
begining of a line. ... Attempts to ensure that all output sent to the stream has reached its
destination, and only then returns false. ...
Attempts to force any buffered output to be sent. ... This is like cl:clear-output, but for Gray streams. ...
Write enough blank space so that the next character will be written at the specified column. ... Other functionsThe other functions for Gray streams are not exported from the package trivial-gray-streams. These functions are:close, open-stream-p, streamp, input-stream-p, output-stream-p, and stream-element-type Binary streamsBinary streams can be created by defining a class that includes either fundamental-binary-input-stream or fundamental-binary-output-stream (or both) and defining a method for stream-element-type and for one or both of the following generic functions. Used by cl:read-byte. Returns either an integer, or the symbol :eof if the stream is at end-of-file. ... Implements cl:write-byte. Writes the integer to the stream and returns the integer as the result. ... ExtensionsWill only be called by LispWorks, CLISP and SBCL.Examples;;;; Here is an example of how the default methods could be ;;;; implemented (omitting the most trivial ones): | Exported Symbol Index |