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 JAA10904; Wed, 12 Sep 2001 09:33:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA10656 for caml-list@pauillac.inria.fr; Wed, 12 Sep 2001 09:33:49 +0200 (MET DST) 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 JAA10246 for ; Wed, 12 Sep 2001 09:01:08 +0200 (MET DST) Received: from hugo.int-evry.fr (hugo.int-evry.fr [157.159.100.81]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8C717D26372 for ; Wed, 12 Sep 2001 09:01:07 +0200 (MET DST) Received: from (rinderkn@localhost) by hugo.int-evry.fr (8.8.8/jtpda-5.3) id JAA01364 ; Wed, 12 Sep 2001 09:00:46 +0200 (MET DST) Date: Wed, 12 Sep 2001 09:00:45 +0200 From: Christian RINDERKNECHT To: SooHyoung Oh Cc: caml-list Subject: Re: [Caml-list] Why warning? Message-ID: <20010912090045.A1262@hugo.int-evry.fr> References: <00b901c13b53$4e3bc9b0$1e01a8c0@hama> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <00b901c13b53$4e3bc9b0$1e01a8c0@hama>; from SooHyoung Oh on Wed, Sep 12, 2001 at 03:22:32PM +0900 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi Soo-Hyoung, 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 The sequence operator ; (semi-colon) is used for composing expressions that may perform some side-effects. This is the typical construct of imperative languages like Pascal. In Caml, such expressions are given the type unit, and the only value of type unit is noted (). It is generally considered as good practice to: (1) make sure that the expressions are of type unit, except maybe the last one, ie. given ; ; .... ; ; , then , , ..., should have type unit; (2) use keywords "begin" and "end" to enclose your sequence: begin ; ; ... ; end So, in your example, 1 is of type int, not unit (hence the warning). For historical reason, this behaviour is not mandatory, and you can turn off this warning in batch mode usign the -W s command-line option. Please refer to http://caml.inria.fr/ocaml/htmlman/manual021.html for other warnings. As far as I am concerned, all warnings are turned into errors:) Hope this helps, -- Christian ----------------------------------------------------------------------- Christian Rinderknecht Phone +82 42 866 6147 Network Architecture Laboratory Fax +82 42 866 6154 Information and Communications University WWW http://nalab.icu.ac.kr 58-4 Hwaam-dong, Yuseong-gu, Daejeon, 305-752, Korea ------------------- 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