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 JAA10617; Wed, 12 Sep 2001 09:17:53 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA10448 for ; Wed, 12 Sep 2001 09:17:53 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.44.193]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8C7HqD26893 for ; Wed, 12 Sep 2001 09:17:52 +0200 (MET DST) Received: (from luther@localhost) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) id JAA01963; Wed, 12 Sep 2001 09:18:22 +0200 Date: Wed, 12 Sep 2001 09:18:22 +0200 From: Sven To: SooHyoung Oh Cc: caml-list Subject: Re: [Caml-list] Why warning? Message-ID: <20010912091822.C1894@dpt-info.u-strasbg.fr> References: <00b901c13b53$4e3bc9b0$1e01a8c0@hama> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <00b901c13b53$4e3bc9b0$1e01a8c0@hama>; from shoh@duonix.com on Wed, Sep 12, 2001 at 03:22:32PM +0900 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Sep 12, 2001 at 03:22:32PM +0900, SooHyoung Oh wrote: > > Why is this warning occurred? > Where can I get infomation about this? (ex: 'nnn' page on manual, articles > or books) > > # 1; 2;; > Warning: this expression should have type unit. > - : int = 2 Because you are throwing away the 1 value, and mostly you don't want to do this, and it is a symptom of a typo or other kind of bug in your program. There trully is no real difference bewteen 1; 2 and simply 2, they are the exact same values. The only reason you would want to do something like that is if you use functions with side effect, in this case, you can either switch off this warning (not recomended) or use the ignore : 'a -> unit function : # ignore (1); 2;; - : int = 2 Which does exactly what you want, without the warning. Friendly, Sven Luther ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr