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 AAA25979; Sat, 6 Mar 2004 00:44:06 +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 AAA26181 for ; Sat, 6 Mar 2004 00:44:05 +0100 (MET) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i25NiIVS011095 for ; Sat, 6 Mar 2004 00:44:18 +0100 Received: (qmail 26005 invoked by uid 65534); 5 Mar 2004 23:44:04 -0000 Received: from pD951D026.dip.t-dialin.net (EHLO badger.home) (217.81.208.38) by mail.gmx.net (mp016) with SMTP; 06 Mar 2004 00:44:04 +0100 X-Authenticated: #19965254 Received: by badger.home (Postfix, from userid 1001) id C621F45E; Sat, 6 Mar 2004 00:46:41 +0100 (CET) To: caml-list@inria.fr Subject: [Caml-list] patterns usage From: Eugene Ossintsev Date: Sat, 06 Mar 2004 00:46:41 +0100 Message-ID: <86u1127t7i.fsf@badger.home> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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; strm:01 strm:01 match:02 match:02 let:04 rewrite:04 stream:07 stream:07 patterns:08 function:09 peek:14 peek:14 hello:15 010:84 010:84 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 60 Hello, There is a construction like match Stream.peek strm with | Some (' ' | '\010' | '\013' | '\009') -> ... | ... which is frequently repeated throughout the code. Is it the "right way" to rewrite it having added let is_space = function | Some (' ' | '\010' | '\013' | '\009') -> true | _ -> false in order to use like match Stream.peek strm with | c when is_space c -> ... | ... ? -- Eugene Ossintsev ------------------- 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