[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Concatenated Stream Query
- To: robbins@DEC-HUDSON.ARPA, common-lisp@SU-AI.ARPA
- Subject: Concatenated Stream Query
- From: Soley@MIT-MC.ARPA
- Date: Wed, 18 Sep 85 16:18 EDT
- In-reply-to: The message of 18 Sep 85 15:50-EDT from robbins at DEC-HUDSON
Date: Wed, 18 Sep 85 15:50:09 EDT
From: robbins@DEC-HUDSON
Subject: Concatenated Stream Query
To: common-lisp@su-ai
Cc: robbins
Given the following streams:
(setf stream-1 (make-string-input-stream "A line without a newline."))
(setf stream-2 (make-string-input-stream "Our generic second line."))
(setf stream-3 (make-concatenated-stream stream-1 stream-2))
What should (read-line stream-3) return, I can imagine two possibilities
(1) "A line without a newline.Our generic second line." t
(2) "A line without a newline." nil
I think it definitely MUST return (1). Consider
(setf stream-1 (make-string-input-stream "A line without a newline.
"))
(setf stream-2 (make-string-input-stream "Our generic second line."))
(setf stream-3 (make-concatenated-stream stream-1 stream-2))
which should return (2). [The next (read-line stream-3) shouldn't
return "", but {"Our generic second line.", t}.
-- Richard