From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA31583; Thu, 13 Sep 2001 08:21:39 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA31842 for ; Thu, 13 Sep 2001 08:21:38 +0200 (MET DST) Received: from areca.wanadoo.fr (smtp-rt-4.wanadoo.fr [193.252.19.156]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8D6LbP03015 for ; Thu, 13 Sep 2001 08:21:37 +0200 (MET DST) Received: from villosa.wanadoo.fr (193.252.19.122) by areca.wanadoo.fr; 13 Sep 2001 08:21:37 +0200 Received: from debian (62.161.110.220) by villosa.wanadoo.fr; 13 Sep 2001 08:21:14 +0200 Received: from moi by debian with local (Exim 3.32 #1 (Debian)) id 15hPsI-0000cR-00 for ; Thu, 13 Sep 2001 08:21:22 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] Obsoluted?: stream matching References: <001801c13c14$9c2530a0$1e01a8c0@hama> From: Remi VANICAT Date: 13 Sep 2001 08:21:22 +0200 In-Reply-To: <001801c13c14$9c2530a0$1e01a8c0@hama> Message-ID: <87wv338vbx.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.105 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "SooHyoung Oh" writes: > It seems that stream matching has been obsoluted, at least in Ocaml 3.02. > Right? No > > # let next = function > [< 'x >] -> x > | [<>] -> raise (Failure "end of stream") > ;; # let next = parser [< 'x >] -> x | [<>] -> raise (Failure "end of stream") ;; val next : 'a Stream.t -> 'a = > 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. http://pauillac.inria.fr/ocaml/htmlman/ -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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