Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Cannot find Stream Parser Documentation
[ 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] Streams
Hi,

> let pc0 c = parser n
>   [< '  x
>         when x == c
>         ?? (string_of_int n ^ ": pc '" ^ String.make 1 c ^ "'")
>   >] -> ();;

The "??" is unuseful for the first element of a stream pattern, because
when it fails, it raises Stream.Failure, not Stream.Error. The "??"
introduces a parameter for Stream.Error. Your code is equivalent to:

  let pc0 c = parser n
    [< '  x
          when x == c
    >] -> ();;

It was an error that the OCaml version accepted the "??" for the first
element.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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