* Error: This function is applied to too many arguments, maybe you forgot a `;'
@ 2008-08-04 0:46 Ben Aurel
2008-08-05 12:11 ` [Caml-list] Error: This function is applied to too many arguments, maybe you forgot a `; ' Richard Jones
0 siblings, 1 reply; 3+ messages in thread
From: Ben Aurel @ 2008-08-04 0:46 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Error: This function is applied to too many arguments, maybe you forgot a `; '
2008-08-04 0:46 Error: This function is applied to too many arguments, maybe you forgot a `;' Ben Aurel
@ 2008-08-05 12:11 ` Richard Jones
2008-08-05 13:29 ` Peng Zang
0 siblings, 1 reply; 3+ messages in thread
From: Richard Jones @ 2008-08-05 12:11 UTC (permalink / raw)
To: Ben Aurel; +Cc: caml-list
On Sun, Aug 03, 2008 at 08:46:32PM -0400, Ben Aurel wrote:
> print_int fac(6);;
Read this: http://www.ocaml-tutorial.org/the_basics
Rich.
--
Richard Jones
Red Hat
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Error: This function is applied to too many arguments, maybe you forgot a `; '
2008-08-05 12:11 ` [Caml-list] Error: This function is applied to too many arguments, maybe you forgot a `; ' Richard Jones
@ 2008-08-05 13:29 ` Peng Zang
0 siblings, 0 replies; 3+ messages in thread
From: Peng Zang @ 2008-08-05 13:29 UTC (permalink / raw)
To: caml-list; +Cc: Ben Aurel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 05 August 2008 08:11:40 am Richard Jones wrote:
> On Sun, Aug 03, 2008 at 08:46:32PM -0400, Ben Aurel wrote:
> > print_int fac(6);;
>
> Read this: http://www.ocaml-tutorial.org/the_basics
>
> Rich.
Second that. You really should take a look at that. Also, this is a great
resource as well:
http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf
You can read that online or print out chapters for offline reading.
Peng
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
iD8DBQFImFXJfIRcEFL/JewRApGmAKDQtoGMfsFjSvvWuXblp/wRVEBOMgCgtsD2
gIoUYouoTrXnTTrUTBSWyxA=
=HtfJ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-05 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-04 0:46 Error: This function is applied to too many arguments, maybe you forgot a `;' Ben Aurel
2008-08-05 12:11 ` [Caml-list] Error: This function is applied to too many arguments, maybe you forgot a `; ' Richard Jones
2008-08-05 13:29 ` Peng Zang
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).