Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Obsoluted?: stream matching
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: SooHyoung Oh <shoh@d...>
Subject: [Caml-list] Obsoluted?: stream matching

It seems that stream matching has been obsoluted, at least in Ocaml 3.02.
Right?

# let next = function
  [< 'x >] -> x
  | [<>] -> raise (Failure "end of stream")
  ;;
Syntax error

Instead of the stream pattern matchng,
do they have to use "peek" & "junk"?

# let next s =
  match Stream.peek s with
  Some x -> Stream.junk s; x
  | None -> raise (Failure "end of stream")
  ;;

p.s.: Where can I find the LATEST document of Ocaml 3.02?
It's VERY VERY DIFFICULT to follow it by trial and error.

---
SooHyoung Oh

-------------------
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