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 KAA21996; Wed, 24 Dec 2003 10:35:10 +0100 (MET) 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 KAA22351 for ; Wed, 24 Dec 2003 10:35:09 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBO9Z7v07521 for ; Wed, 24 Dec 2003 10:35:07 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2-20030924/3.7W) with ESMTP id SAA13712; Wed, 24 Dec 2003 18:35:00 +0900 (JST) To: bhurt@spnz.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] Frustrated Beginner In-Reply-To: References: <20031223162004.GA25221@iliana> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20031224183500I.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 24 Dec 2003 18:35:00 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 jacques:01 avoiding:01 discards:01 jacques:01 compiler:01 garrigue:01 garrigue:01 behaviour:01 mmm:02 unit:03 unit:03 differs:03 partial:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Brian Hurt > > Mmm, not really convinced. For me ;, is a shortcut for : > > > > let () = ... in > > Or more accurately > let _ = ... in ... Well, both wrong :-) The error/warning behaviour differs. Actually, there are 4 possibilities: construct \ type unit 'a function other let () = ... in ... OK OK(*) error error let _ = ... in ... OK OK OK OK ignore (...); ... OK OK warning OK ...; ... OK OK warning warning (*) the result type is unified with unit. So, you have plenty of choice on how to sequence your code. Additionally there are compiler options to ignore warnings or turn them into errors. (Having been bitten several times, I actually suggest avoiding "let _" as it discards the very useful partial application warning. But of course your need it for side-effecting code returning a function.) Jacques ------------------- 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