Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] mixing fast and [<>] stream: illegal?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] mixing fast and [<>] stream: illegal?
Hi,

On Sun, Nov 04, 2001 at 06:59:52PM +0100, Stefano Zacchiroli wrote:

> Seems to me that no illegal action was performed ...
> Am I wrong?
> Is really dangerous mixing the two streams?

The doc meant "streams expressions built with [< >]", not parsers. The [< >]
in parsers are stream patterns, not stream expressions. Your code is ok.

What does not work are things like [< '1; Stream.from gen; '2 >].
It is not dangerous, it will just fail:

  # let gen i = Some i;;       
  val gen : 'a -> 'a option = <fun>
  # let s = [< '1; Stream.from gen; '2 >];;
  val s : int Stream.t = <abstr>
  # Stream.next s;;
  - : int = 1
  # Stream.next s;;
  Uncaught exception: Failure "illegal stream concatenation".

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr