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
newbie: how to call a function with multiple parameters?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-08-05 (11:40)
From: asmadeus77@g...
Subject: Re: [Caml-list] newbie: how to call a function with multiple parameters?
semicolons are separator inside sentences, that is, just like in C
(you've had theses right)
double semicolons are to tell the compiler you're ending a sentence;
theses can be ommited when there is no ambiguity in the syntax, that
is when there is another "main" let after it. Here, you need them on
line 4.

As for arguments, ocaml works by passing one argument, then gives back
another function, then takes another argument, returns another
function, etc... If you wanted to have a tuple, you'd define the
function with "let print_logic (a, b) ="
Here, since you've defined it with "a b", you need to call it with a
THEN with b. That is : "print_logic true false"

Hope this helps,