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 NAA22750; Sun, 9 Sep 2001 13:27:55 +0200 (MET DST) 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 NAA22700 for ; Sun, 9 Sep 2001 13:27:54 +0200 (MET DST) Received: from camelia.wanadoo.fr (smtp-rt-10.wanadoo.fr [193.252.19.59]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f89BRsP08063 for ; Sun, 9 Sep 2001 13:27:54 +0200 (MET DST) Received: from citronier.wanadoo.fr (193.252.19.222) by camelia.wanadoo.fr; 9 Sep 2001 13:27:53 +0200 Received: from debian (213.56.53.124) by citronier.wanadoo.fr; 9 Sep 2001 13:27:09 +0200 Received: from moi by debian with local (Exim 3.32 #1 (Debian)) id 15g2iU-00019B-00 for ; Sun, 09 Sep 2001 13:25:34 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] This expression is not a function, it cannot be applied References: <871ylgk4ag.fsf@adept.co.za> From: Remi VANICAT Date: 09 Sep 2001 13:25:34 +0200 In-Reply-To: <871ylgk4ag.fsf@adept.co.za> Message-ID: <874rqcehch.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.104 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Johann Spies writes: > Hello, > # let rec druk_tabel hoofsom pmnt j n maand = match (maand, hoofsom) with > (n, 0.) -> () > |(0., _) -> print_string "ongeldige tydperk\n"; print_newline() > | (_, _) -> if maand == 1. then Printf.printf "Maand\tBedrag\tRente\tAfbetaal"; > let rente = hoofsom *. j in > let afbetaal = pmnt -. rente in > let nuwe_hoofsom = hoofsom -. afbetaal in > druk_ry (maand hoofsom rente afbetaal); > druk_tabel nuwe_hoofsom pmnt j n maand+1;; > > Characters 424-429: > This expression is not a function, it cannot be applied > ---------------------------- > The culprit is "maand " in the second last row (druk_ry (maand...)) > > Why can it not be applied? you do a match (maand, hoofsom) with ... | (0.,_) -> so the compiler thinks that maand is a float, not a function. and then you do a (maand hoofsom rente afbetaal) which mean: apply the function maand to the argument hoofsom rente and afbetaal, so it is an error since maand is not a function. -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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