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] 'should have type unit' warning in 'let _ =' ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-15 (00:29)
From: henridf@l...
Subject: [Caml-list] 'should have type unit' warning in 'let _ =' ?

i had a minor bug where the last expression in a 
let _ = ...
block of my module was not fully applied and hence was returning a 
functional value rather than apply the function (because I had added a 
parameter to the function).

pretty harmless, but it led me to wonder why I wasn't writing 'let () = 
..' for all my module initialization blocks, which would have given me 
'warning should have type unit' in the above situation.

So is there a reason why the commonly used idiom seems to be 'let _ =' 
rather than 'let () = '? 



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