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 OAA05302; Tue, 8 Jan 2002 14:16:55 +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 OAA05033 for ; Tue, 8 Jan 2002 14:16:54 +0100 (MET) Received: from ionie.inria.fr (ionie.inria.fr [128.93.39.12]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g08DGr112066 for ; Tue, 8 Jan 2002 14:16:53 +0100 (MET) Received: from ionie.inria.fr (localhost [127.0.0.1]) by ionie.inria.fr (8.11.1/8.11.1) with ESMTP id g08DGrv08292 for ; Tue, 8 Jan 2002 14:16:53 +0100 (MET) Message-Id: <200201081316.g08DGrv08292@ionie.inria.fr> X-Mailer: exmh version 2.1.1 10/15/1999 To: caml-list@inria.fr Subject: Re: [Caml-list] Function definition with multiple patterns in multiple equations In-Reply-To: Message from =?iso-8859-1?Q?Jos=E9_Romildo_Malaquias?= of "Tue, 08 Jan 2002 11:08:36 -0200." <20020108110836.A9147@darling.home.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Tue, 08 Jan 2002 14:16:53 +0100 From: Francois Thomasset Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I am trying to define a function in OCaml with multiple equations (rules) > and multiple patterns in each equation. It looks like this is what you want: let f x = function 0 when x = 0 -> 1 | _ -> 0;; -- François Thomasset. INRIA (A3) Tel: +33 (1) 39-63-54-75 Fax: +33 (1) 39-63-53-30 ou +33 (1) 39-63-59-95 Email: Francois.Thomasset@inria.fr Smail: INRIA, Rocquencourt, BP 105, 78153 Le Chesnay Cedex, France ------------------- 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