caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Compilation problem in OCAML 3.02 and 3.04
@ 2002-02-25 16:13 Stagiaire Bioinfo 2001-2002
  2002-02-26 17:53 ` Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Stagiaire Bioinfo 2001-2002 @ 2002-02-25 16:13 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

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 :
/tmp/camlasm29.s: Assembler messages:
/tmp/camlasm29.s:2: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:3: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:5: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:6: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:9: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:10: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:14: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:15: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:16: Warning: rest of line ignored; first ignored
character is `a'
/tmp/camlasm29.s:20: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:21: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:28: Error: junk `act_fact_49' after expression
/tmp/camlasm29.s:45: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:46: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:48: Error: junk `act_1' after expression
/tmp/camlasm29.s:49: Error: junk `act' after expression
/tmp/camlasm29.s:53: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:54: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:56: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:57: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:59: Warning: rest of line ignored; first ignored
character is `1'
/tmp/camlasm29.s:60: Warning: rest of line ignored; first ignored
character is `1'
Assembler error, input left in file /tmp/camlasm29.s


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.
Is it normal?


Thank you.
Sarah Djebali.

[-- Attachment #2: Type: text/html, Size: 2537 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Compilation problem in OCAML 3.02 and 3.04
  2002-02-25 16:13 [Caml-list] Compilation problem in OCAML 3.02 and 3.04 Stagiaire Bioinfo 2001-2002
@ 2002-02-26 17:53 ` Xavier Leroy
  2002-02-27  7:00   ` malc
  0 siblings, 1 reply; 3+ messages in thread
From: Xavier Leroy @ 2002-02-26 17:53 UTC (permalink / raw)
  To: Stagiaire Bioinfo 2001-2002; +Cc: caml-list

> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Compilation problem in OCAML 3.02 and 3.04
  2002-02-26 17:53 ` Xavier Leroy
@ 2002-02-27  7:00   ` malc
  0 siblings, 0 replies; 3+ messages in thread
From: malc @ 2002-02-27  7:00 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: Stagiaire Bioinfo 2001-2002, caml-list

On Tue, 26 Feb 2002, Xavier Leroy wrote:

> > 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.

Typo here fact1.ml --> Fact1, and NOT Fact.

-- 
mailto:malc@pulsesoft.com

-------------------
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-02-26 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-25 16:13 [Caml-list] Compilation problem in OCAML 3.02 and 3.04 Stagiaire Bioinfo 2001-2002
2002-02-26 17:53 ` Xavier Leroy
2002-02-27  7:00   ` malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).