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 NAA04768; Tue, 8 Jan 2002 13:58:36 +0100 (MET) 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 NAA04371 for ; Tue, 8 Jan 2002 13:58:35 +0100 (MET) Received: from darling.home.br (ctbcnetsuper-138.xdsl-dinamico.ctbcnetsuper.com.br [200.225.204.138]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g08CwVr10981 for ; Tue, 8 Jan 2002 13:58:33 +0100 (MET) Received: (from romildo@localhost) by darling.home.br (8.11.6/8.11.6) id g08D8a109206; Tue, 8 Jan 2002 11:08:36 -0200 Date: Tue, 8 Jan 2002 11:08:36 -0200 From: =?iso-8859-1?Q?Jos=E9_Romildo_Malaquias?= To: caml-list@inria.fr Subject: [Caml-list] Function definition with multiple patterns in multiple equations Message-ID: <20020108110836.A9147@darling.home.br> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello. I am trying to define a function in OCaml with multiple equations (rules) and multiple patterns in each equation. I have tried the 3 forms below, without success. let f 0 0 = 1 | f _ _ = 0 let f = fun 0 0 -> 1 | _ _ -> 0 let f = function 0 0 -> 1 | _ _ -> 0 None of them seems to be supported by the language. In SML, one can write fun f 0 0 = 1 | f _ _ = 0 What is the equivalent in OCaml? Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br ------------------- 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