English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2001-09-13 (05:23)
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.

# 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