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 SAA17027; Tue, 26 Feb 2002 18:53:40 +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 SAA17157 for ; Tue, 26 Feb 2002 18:53:39 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g1QHrcr06015; Tue, 26 Feb 2002 18:53:38 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA16608; Tue, 26 Feb 2002 18:53:38 +0100 (MET) Date: Tue, 26 Feb 2002 18:53:38 +0100 From: Xavier Leroy To: Stagiaire Bioinfo 2001-2002 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Compilation problem in OCAML 3.02 and 3.04 Message-ID: <20020226185338.A16752@pauillac.inria.fr> References: <3C7A62C2.3D9C658A@lami.univ-evry.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3C7A62C2.3D9C658A@lami.univ-evry.fr>; from stagbio1@lami.univ-evry.fr on Mon, Feb 25, 2002 at 05:13:55PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I am a student in Computer Science in the University of Evry (France), > and I tried to compile a simple ocaml program : > > let rec fact = function > 0 -> 1 | n-> n*(fact(n-1));; > > Unfortunately, the "ocamlopt 1fact.ml" command gave me the following > answer : > > I think this is due to the name of the program, 1fact.ml, which should > not begin with a number, because when I renamed the file fact1.ml it > worked perfectly. Correct. The name of a Caml compilation unit is derived from its source file name (e.g. fact1.ml --> Fact), and must be a valid Caml identifier. > Is it normal? Well, it could be argued that the compiler should check the file names and emit a more descriptive error than the one you obtained. But since you understood the problem perfectly well and found the fix yourself... :-) - Xavier Leroy ------------------- 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