English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2004-08-03 (15:11)
From: John Prevost <j.prevost@g...>
Subject: Re: [Caml-list] let () =
It really means "I expect bla to have type unit, and am executing it
here for side effects."  Some people write instead:

let _ = bla

Which means "I don't care what type bla has, but am executing it for
side effects."  The let () one is somewhat safer because you are
explicitly saying you don't expect the call to return anything.  The _
one, you might leave an argument out, and it would still typecheck.

JOhn.

-------------------
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