Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Compilation problem in OCAML 3.02 and 3.04
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Compilation problem in OCAML 3.02 and 3.04
> 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" command gave me the following
> answer :
> I think this is due to the name of the program,, which should
> not begin with a number, because when I renamed the file it
> worked perfectly.

Correct.  The name of a Caml compilation unit is derived from its
source file name (e.g. --> Fact), and must be a valid Caml

> 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 Archives:
Bug reports: FAQ:
Beginner's list: