From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA20836; Tue, 15 Jul 2003 02:29:54 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA19358 for ; Tue, 15 Jul 2003 02:29:53 +0200 (MET DST) Received: from lcavsun1.epfl.ch (lcavsun1.epfl.ch [128.178.8.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6F0TqT02006 for ; Tue, 15 Jul 2003 02:29:52 +0200 (MET DST) Received: from lcmpc4.epfl.ch (lcmpc4.epfl.ch [128.178.8.59]) by lcavsun1.epfl.ch (8.8.8+Sun/8.8.8) with ESMTP id CAA14317 for ; Tue, 15 Jul 2003 02:29:51 +0200 (MET DST) Date: Tue, 15 Jul 2003 02:29:51 +0200 (CEST) From: henridf@lcavsun1.epfl.ch X-X-Sender: henridf@lcmpc4.epfl.ch To: caml-list@inria.fr Subject: [Caml-list] 'should have type unit' warning in 'let _ =' ? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; henridf:01 lcavsun:01 'let:01 bug:01 module:03 henri:03 let:04 parameter:04 epfl:05 seems:05 functional:06 blocks:06 type:07 minor:07 idiom:08 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk hi, 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 () = '? Thanks Henri ------------------- 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