| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1 Read macros 3.2 Input and Output Functions 3.3 Network Streams 3.4 CLOS Streams
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#"string" reads a pathname. #"string" is equivalent
to (pathname "string").
#$integer reads a random state. #$integer is
equivalent to (make-random-state integer).
The # macro '#,' works as described in [see section Steele:84], only
if it is included in a constant object. The forms immediately after
`#,' below will be evaluated when the compiled code is loaded.
'#,x '(a b c (d #,e f) g) #(1 2 3 #,(+ a b c) 5 6) #C(0.0 #,(exp 1)) |
Otherwise, the effect of using '#,' is unpredictable. Note that, when
interpreted code is loaded, '#,' has the same effect as the #
macro '#.'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The input and output functions of ECL almost follow the definitions in Chapter 22 of [see section Steele:84]. Most of the differences come from the fact that, in ECL, input from the terminal is always in line mode and binary I/O is not supported.
In ECL, *terminal-io* is a two-way stream from the standard input
and to the standard output. The echoing to the terminal is performed by the
underlying operating system. In particular, when a disk file is assigned to
the standard output, nothing will be echoed at the terminal.
Those functions that deviate from the definitions in [see section Steele:84] are listed below.
.fas, .lsp and .lisp, in this order. If
everything fails, a file without filetype will be loaded.
base-char, (signed-byte 8)
and (unsigned-byte 8). The :external-format is always :default.
Windows). When ECL is not able to
determine whether a stream is interactive, listen returns true unless
an end of file has been previously detected.
clear-input and clear-output do nothing.
read-char-no-hang is equivalent to read-char.
The functions princ, write-char and write-byte do not
always flush the stream. The stream is flushed when
*terminal-io*
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
With a configuration option, the following function is available which opens streams across network connections.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When the optional CLOS subsystem is available, an interface is provided by
ECL for using CLOS objects as Common-Lisp
Such support can be used for instance to build interactive character streams,
which may be used by applications as the stream argument for Common-Lisp
functions such as read, listen, prin1, etc. The
fundamental interface to clos-stream objects consists of
(generic) functions which implement the basic Common-Lisp
operations (see Common-Lisp@c, Chapter 22) but whose details are implementation
dependent.
The following functions are automatically invoked by ECL when a stream operation involves a CLOS object as a stream parameter. The programmer should define these methods for any class of objects which are to be used for character input/output.
3.4.1 CLOS Stream Input 3.4.2 CLOS Stream Output 3.4.3 CLOS Stream common
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Character input from an clos-stream is implemented by the
following methods.
stream-read-char.
stream-peek-char had been called.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Character output from an clos-stream is implemented by the
following methods.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following functions should be available for all CLOS streams.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |