Browse thread
Re: stream
- Michel.Mauny@i...
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 1996-02-29 (12:39) |
From: | Michel.Mauny@i... |
Subject: | Re: stream |
Bonjour, > J'ai une conversation "bizarre" avec caml-light a propos des > stream. J'ai essaye de fouiller dans les docs, je n'ai pas trouve de > reponse. > > Est ce que caml-light privilegie le dernier element non > terminal des stream ? > [...] > #pr toto;; > 123- : unit = () (***** Je comprends un peu moins ou pas du tout. Remarquons tata est a la fin > de [< toto; tata >] > *****) C'est un comportement décrit dans la liste des bugs connus de Caml-Light 0.7. Vous vous attendiez à juste titre à ce que "tata" soit vidé par le parcours de [< toto; tata >]. Vous trouverez ci-dessous un extrait du fichier KNOWN-BUGS de la distribution 0.7, qui indique notamment comment contourner ce bug. Cordialement, -- Michel Mauny --------------------------------------------------------------------------- The following problems have not been fixed at the time of this release: 1- Stream concatenation using [< ... >] does not always preserve the sharing among streams, and sometimes duplicate stream subcomponents. For instance, if you define s' = [< '1; s >] and then read alternatively from s' and from s, a given element of s can be read twice. The problem occurs only if s is in tail position inside s'. To guarantee proper sharing, move s in non-tail position, e.g. take s' = [< '1; s; [<>] >]. ---------------------------------------------------------------------------