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 PAA06128; Tue, 9 Mar 2004 15:12:04 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA06093 for ; Tue, 9 Mar 2004 15:12:03 +0100 (MET) Received: from interferon.mpi-sb.mpg.de (mailhost.mpi-sb.mpg.de [139.19.1.1]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i29ECKKW006566 for ; Tue, 9 Mar 2004 15:12:20 +0100 Received: from amavis by interferon.mpi-sb.mpg.de with scanned-ok (Exim 3.35 #1 (Debian)) id 1B0hxi-00086U-00 for ; Tue, 09 Mar 2004 15:12:02 +0100 Received: from data ([139.19.90.238] helo=mpi-sb.mpg.de) by interferon.mpi-sb.mpg.de with esmtp (Exim 3.35 #1 (Debian)) id 1B0hxf-00086K-00; Tue, 09 Mar 2004 15:11:59 +0100 Received: from mpiat2314 (mail@mpiat2314 [139.19.20.103]) by mpi-sb.mpg.de (8.12.9+Sun/8.12.9) with ESMTP id i29EBxLT021138; Tue, 9 Mar 2004 15:11:59 +0100 (MET) Received: from localhost ([127.0.0.1] helo=mpiat2314 ident=prevosto) by mpiat2314 with smtp (Exim 3.35 #1 (Debian)) id 1B0hxf-0007tp-00; Tue, 09 Mar 2004 15:11:59 +0100 Date: Tue, 9 Mar 2004 15:11:59 +0100 From: Virgile Prevosto To: Eugene Ossintsev Cc: caml-list@inria.fr Subject: Re: [Caml-list] patterns usage Message-Id: <20040309151159.4d027507.prevosto@mpi-sb.mpg.de> In-Reply-To: <86u1127t7i.fsf@badger.home> References: <86u1127t7i.fsf@badger.home> X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS perl-11 X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; virgile:01 prevosto:01 prevosto:01 caml-list:01 strm:01 camlp:01 camlp:01 -pp:01 virgile:01 compiler:01 ecrit:01 ocaml:01 caml:01 command:98 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 86 Le samedi 06 mars, =E0 0h46 +0100, Eugene Ossintsev a =E9crit: > Is it the "right way" to rewrite it having added > let is_space =3D function > | Some (' ' | '\010' | '\013' | '\009') -> true > | _ -> false >=20 > in order to use like >=20 > match Stream.peek strm with > | c when is_space c -> ... > | ... Hi, your solution should work without any problem, but you might be interested in camlp4's syntax to handle streams (http://caml.inria.fr/camlp4/manual/manual003.html). In this case, you'll have to add -pp camlp4o as a command line option to the ocaml compiler (or use the directive #load camlp4o.cma;; in the interpreter). --=20 E tutto per oggi, a la prossima volta Virgile ------------------- 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