From: Marco Antoniotti
Subject: READ-SEQUENCE
Date: 
Message-ID: <MARCOXA.95Aug10085257@mosaic.robotics>
Hello

can anybody post the ANSI definition (at least the signature) of
READ-SEQUENCE?

Thanks

-- 
Marco G. Antoniotti - Resistente Umano
-------------------------------------------------------------------------------
Robotics Lab		| room: 1220 - tel. #: (212) 998 3370
Courant Institute NYU	| e-mail: ·······@cs.nyu.edu
			| WWW:    http://found.cs.nyu.edu/marcoxa

...e` la semplicita` che e` difficile a farsi.
...it is simplicity that is difficult to make.
				Bertholdt Brecht

From: Erik Naggum
Subject: Re: READ-SEQUENCE
Date: 
Message-ID: <19950810T145726Z@naggum.no>
[Marco Antoniotti]

|   can anybody post the ANSI definition (at least the signature) of
|   READ-SEQUENCE?

read-sequence (sequence stream &key start end)
=> position

Description:
Destructively modifies /sequence/ by replacing the elements of /sequence/
bounded by /start/ and /end/ with elements read from /stream/.

Example:
(defvar *data* (make-array 15 :initial-element nil))
(values (read-sequence *data* (make-string-input-stream "test string")) *data*)
=>  11, #(#\t #\e #\s #\t #\Space #\s #\t #\r #\i #\n #\g NIL NIL NIL NIL)

Note:
read-sequence is identical in effect to iterating over the indicated
subsequence and reading one element at a time from stream and storing it
into sequence, but may be more efficient than the equivalent loop.  An
efficient implementation is more likely to exist for the case where the
sequence is a vector with the same element type as the stream.

#<Erik 3017055445>
-- 
#<Xyzzy 202B370B73>
From: Pete Halverson
Subject: Re: READ-SEQUENCE
Date: 
Message-ID: <pch-1008952203400001@m072.mystech.com>
In article <················@naggum.no>, Erik Naggum <····@naggum.no> wrote:

> [Marco Antoniotti]
> 
> |   can anybody post the ANSI definition (at least the signature) of
> |   READ-SEQUENCE?
> 
> read-sequence (sequence stream &key start end)
> => position
> 
> Description:
> Destructively modifies /sequence/ by replacing the elements of /sequence/
> bounded by /start/ and /end/ with elements read from /stream/.

> Note:
> read-sequence is identical in effect to iterating over the indicated
> subsequence and reading one element at a time from stream and storing it
> into sequence, but may be more efficient than the equivalent loop.  An
> efficient implementation is more likely to exist for the case where the
> sequence is a vector with the same element type as the stream.

As long as someone else brought up this particular subject, I've been
wondering about the intended interaction of READ-SEQUENCE with
fill-pointers

  - if SEQUENCE is a vector with a fill-pointer, is it altered by READ-SEQUENCE?
  - if SEQUENCE is also an adjustable vector, and its size is <= END, is
the SEQUENCE
    extended (as if the elements were added by use of VECTOR-PUSH-EXTEND)
or is it an   
    error? (signallable or not)

Or does READ-SEQUENCE, like the other general sequence funs, only operate
on the active length of SEQUENCE, reads past the fill-pointer being in
error?

pch
From: Erik Naggum
Subject: Re: READ-SEQUENCE
Date: 
Message-ID: <19950811T114713Z@naggum.no>
[Pete Halverson]

|   As long as someone else brought up this particular subject, I've been
|   wondering about the intended interaction of READ-SEQUENCE with
|   fill-pointers
|   
|     - if SEQUENCE is a vector with a fill-pointer, is it altered by
|       READ-SEQUENCE?
|     - if SEQUENCE is also an adjustable vector, and its size is <= END,
|       is the SEQUENCE extended (as if the elements were added by use of
|       VECTOR-PUSH-EXTEND) or is it an error? (signallable or not)
|   
|   Or does READ-SEQUENCE, like the other general sequence funs, only
|   operate on the active length of SEQUENCE, reads past the fill-pointer
|   being in error?

if being a language-lawyer for some other standards is a transferable trait
(I fear it is), my reading of `read-sequence' is that it "destructively
modifies" an existing subsequence, as opposed to "creatively modifying" it
such as moving fill-pointers and extending adjustable vectors.  (note: the
term "creatively modify" is not in the standard.)

#<Erik 3017130433>
-- 
#<Xyzzy 202B370B73>
From: Bruno Haible
Subject: Re: READ-SEQUENCE
Date: 
Message-ID: <HAIBLE.95Aug21192430@laplace.ilog>
Pete Halverson <···@mystech.com> writes:

>   Or does READ-SEQUENCE, like the other general sequence funs, only operate
>   on the active length of SEQUENCE, reads past the fill-pointer being in
>   error?

That's my understanding of the standard.

Please note for portability that, in CLISP, this function is called
READ-CHAR-SEQUENCE for character streams and READ-BYTE-SEQUENCE for
binary streams.


Bruno Haible                                     email: <······@ilog.fr>
Software Engineer                                phone: +33-1-49083585