Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: help an o'caml beginner
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brent Fulgham <brent.fulgham@x...>
Subject: RE: help an o'caml beginner
> > <question type="stupid">
> >     What does the keyword "in" mean?
> > </question>
> 
> It is just a keyword to prevent ambiguities when writing 
> expressions. E.g.:
> 
>   let x = y z ...
> 
> is not the same as
> 
>   let x = y in
>   z ...
>

It's a way to "hide" functions inside of other functions.
Like in the tail-recursive case I posted, I cluttered the
namespace with the second "internal" recursive function.
In a real program it is better to hide that "internal" function
from the outside world:

let firstFunction x = blah blah
  in
     secondFunction y = blah blah (uses firstFunction);;

Thanks,

-Brent