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 UAA29462; Mon, 3 May 2004 20:37:11 +0200 (MET DST) 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 UAA28245 for ; Mon, 3 May 2004 20:37:10 +0200 (MET DST) Received: from oceanite.ens-lyon.fr (oceanite.ens-lyon.fr [140.77.1.22]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i43Ib9EV017936 for ; Mon, 3 May 2004 20:37:09 +0200 Received: from localhost (oceanite.ens-lyon.fr [127.0.0.1]) by oceanite.ens-lyon.fr (Postfix) with ESMTP id A11B53204AC; Mon, 3 May 2004 20:36:54 +0200 (CEST) Received: from oceanite.ens-lyon.fr ([127.0.0.1]) by localhost (oceanite [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23747-02; Mon, 3 May 2004 20:36:54 +0200 (CEST) Received: from ens-lyon.fr (unknown [140.77.128.163]) by oceanite.ens-lyon.fr (Postfix) with ESMTP id 68B213203F0; Mon, 3 May 2004 20:36:54 +0200 (CEST) Message-ID: <4096918B.6060508@ens-lyon.fr> Date: Mon, 03 May 2004 20:38:03 +0200 From: Jean-Baptiste Rouquier User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: Holger Schulz Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] OCaml error message References: <14600.1083608359@www62.gmx.net> In-Reply-To: <14600.1083608359@www62.gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ens-lyon.fr X-Miltered: at nez-perce with ID 40969155.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ens-lyon:01 caml-list:01 inference:01 beginners:01 ens-lyon:01 ---cut---:01 ---cut---:01 val:01 val:01 ocaml:01 ocaml:01 int:01 int:01 groups:01 rec:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Replace "div" with "/". By the way, you don't need to write the types of the functions : just write let rec ggT (x,y) = if y = 0 then x else ggT (y, x mod y) and rely on type inference. There is also a beginer's list : http://groups.yahoo.com/group/ocaml_beginners/. Regards, Jean-Baptiste Rouquier http://perso.ens-lyon.fr/jean-baptiste.rouquier >---cut--- >type rat = int * int;; > >exception Denominator_Zero;; > >let rec ggT : (int * int) -> int = fun (x,y) -> if y = 0 then x else ggT >(y, x mod y) > >let kgV : int * int -> int = fun (x,y) -> (x / ggT (x,y)) * y > >let kuerze : rat -> rat = function (m,n) -> if n = 0 then raise >Denominator_Zero > else let g=ggT (m,n) in (m div g,n div g) >---cut--- > >Loading it with #use give the following error message, which I do not >understand. Could anyone help me? > >---cut-- ># #use "B2A3.ml";; >type rat = int * int >exception Denominator_Zero >val ggT : int * int -> int = >val kgV : int * int -> int = >File "B2A3.ml", line 10, characters 29-30: >This expression is not a function, it cannot be applied >---cut--- > ------------------- 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