From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 441C4BBAF for ; Mon, 4 Aug 2008 02:58:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqsGAPfwlUhQDPJjX2dsb2JhbACCJC2OZBcEBwgQMJs0 X-IronPort-AV: E=Sophos;i="4.31,302,1215381600"; d="scan'208,217";a="15778554" Received: from smtp28.orange.fr ([80.12.242.99]) by mail1-smtp-roc.national.inria.fr with ESMTP; 04 Aug 2008 02:58:26 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2804.orange.fr (SMTP Server) with ESMTP id 65E1280000A1 for ; Mon, 4 Aug 2008 02:58:25 +0200 (CEST) Received: from Thinkpad-R60 (Mix-Lyon-303-1-46.w193-248.abo.wanadoo.fr [193.248.43.46]) by mwinf2804.orange.fr (SMTP Server) with SMTP id 5FA4480000A0 for ; Mon, 4 Aug 2008 02:58:24 +0200 (CEST) X-ME-UUID: 20080804005824391.5FA4480000A0@mwinf2804.orange.fr Date: Mon, 4 Aug 2008 03:00:06 +0200 From: "Damien Guichard" To: "caml-list@yquem.inria.fr" Subject: Re: [Caml-list] Error: This function is applied to too many arguments,maybe you forgot a `; ' X-mailer: Foxmail 5.0 [-fr-] Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====003_Dragon522436338336_=====" Message-Id: <20080804005824.5FA4480000A0@mwinf2804.orange.fr> X-Spam: no; 0.00; damien:01 guichard:01 damien:01 ocaml:01 ocaml:01 ocamlc:01 beginner's:01 bug:01 ocamlc:01 beginner's:01 bug:01 beginners:01 beginners:01 rec:01 rec:01 This is a multi-part message in MIME format. --=====003_Dragon522436338336_===== Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, This line: print_int fac(6);; Can be read as: print_int fac 6;; That is 2 arguments whereas print_int expects exactly 1 argument. The corrected line is: print_int (fac 6);; Note that function application is just juxtaposition, parenthesis are unneded. Regards, - damien hi I try to make my first steps with Ocaml and I have some difficulties. I know there is a second list for "Ocaml Beginners" but its running on Yahoo and the membership confirmation takes a while ... So let me ask you, what is wrong with this code let rec fac n = if n > 1 then n * fac (n-1) else 1 ;; print_int fac(6);; No matter if I compile this with ocamlc or run the commands with ocaml, I always get the error: ///////////////////////////////////////////////////////////////// File "ifelse.ml", line 2, characters 0-9: This function is applied to too many arguments, maybe you forgot a `;' /////////////////////////////////////////////////////////////////// What is the problem here? Adding an additional ; doesn't help of course. thanks ben _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs --=====003_Dragon522436338336_===== Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit
Hi,
 
This line:
 
    print_int fac(6);;
 
Can be read as:
 
    print_int fac 6;;
 
That is 2 arguments whereas print_int expects exactly 1 argument.
 
The corrected line is:
 
    print_int (fac 6);;
 
Note that function application is just juxtaposition, parenthesis are unneded.
 
Regards,
 
- damien
 
 

 
hi
I try to make my first steps with Ocaml and I have some difficulties.
I know there is a second list for "Ocaml Beginners" but its running on
Yahoo and the membership confirmation takes a while ...
 
So let me ask you, what is wrong with this code
 
let rec fac n = if n >  1 then n * fac (n-1) else 1 ;;
print_int fac(6);;
 
No matter if I compile this with ocamlc or run the commands with
ocaml, I always get the error:
/////////////////////////////////////////////////////////////////
File "ifelse.ml", line 2, characters 0-9:
This function is applied to too many arguments,
maybe you forgot a `;'
///////////////////////////////////////////////////////////////////
 
What is the problem here? Adding an additional ; doesn't help of course.
 
thanks
ben
 
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
 

--=====003_Dragon522436338336_=====--