Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] let () =
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] let () =
> Hello World!
>
> Can anyone answer my silly question: what does "let () = bla" really mean?

let () = bla is equivalent to writing bla; but is opening a block if
followed by an 'in'.

Here are the different forms :

bla; (* warning if partial application or if returned type not unit *)
ignore(bla); (* warning if partial application, ignore returned type *)
let () = bla (* error if partial application or if returned type not unit *)
let _ = bla (* no warning or errors !! be careful if you want to use it *)

Regards,
Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners