Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: asmadeus77@g...
Subject: Re: [Caml-list] newbie: how to call a function with multiple parameters?
Hello,
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,
Asmadeus