Version française
Home     About     Download     Resources     Contact us    
Browse thread
Error: This function is applied to too many arguments, maybe you forgot a `;'
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ben Aurel <ben.aurel@g...>
Subject: Error: This function is applied to too many arguments, maybe you forgot a `;'
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