stream feature

poirriez (Vincent.Poirriez@univ-valenciennes.fr)
Tue, 10 Dec 1996 12:56:16 +0100 (MET)

Message-Id: <199612101156.MAA26517@pulsar.univ-valenciennes.fr>
From: Vincent.Poirriez@univ-valenciennes.fr (poirriez)
Subject: stream feature
To: caml-list@inria.fr
Date: Tue, 10 Dec 1996 12:56:16 +0100 (MET)

Hello every body,
(Hope my english is not to bad)
I am wondering if it's a bug or a feature:

Objective Caml version 1.03

# let s = [<''c';''d'>];;
val s : char Stream.t = <abstr>
# let t = [<''a';''b';s;''e'>];;
val t : char Stream.t = <abstr>
# Stream.next s;;
- : char = 'c'
# Stream.iter print_char t;print_newline();;
abde
- : unit = ()
# Stream.next t;;
Uncaught exception: Parse_failure

until this point, no surprise

# Stream.next s;;
- : char = 'd'

But here, I was expecting s to be empty as t.

Thus s is not really a sub-stream of t and we can't consider t to contain
a copy of s as if the head of s is consumed, it desappears of t to.

To resume, I found surprising the following non symetric feature
let s appears as a sub stream of t, if s is consumed, it is consumed in t,
if t is consumed, it is not consumed in s

-- 
Vincent POIRRIEZ                
Tel: (33) {0}3 27 14 13 33   
Fax: (33) {0}3 27 14 11 50      
email: Vincent.Poirriez@univ-valenciennes.fr
ISTV Université de Valenciennes Le Mont Houy BP 311 F59304 Valenciennes CEDEX