Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

READ-SEQUENCE

11 views
Skip to first unread message

Marco Antoniotti

unread,
Aug 10, 1995, 3:00:00 AM8/10/95
to

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: mar...@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

Erik Naggum

unread,
Aug 10, 1995, 3:00:00 AM8/10/95
to
[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>

Pete Halverson

unread,
Aug 10, 1995, 3:00:00 AM8/10/95
to
In article <19950810...@naggum.no>, Erik Naggum <er...@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

Erik Naggum

unread,
Aug 11, 1995, 3:00:00 AM8/11/95
to
[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>

Bruno Haible

unread,
Aug 21, 1995, 3:00:00 AM8/21/95
to
Pete Halverson <p...@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: <hai...@ilog.fr>
Software Engineer phone: +33-1-49083585

0 new messages