Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Streams.from
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] Streams.from
Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr> writes:

> Nick Grey writes:
>  > 
>  > When a stream is created using Stream.from, is the function f garunteed
>  > to be called with the stream count parameter 0, 1, 2, ...
>
> No. For instance, repeated calls to Stream.peek will clearly call f
> several times on the same count value (see the code in
> stdlib/stream.ml)

Stream.peek cache value from parser created by Stream.from. So the
answer is that with the current implementation of all the function of
the module Stream, f will be call one, and only one time for each
count parameter, and in the good order. But this is not written in the
specification. 



-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners