From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA16818 for caml-redistribution; Fri, 19 Feb 1999 19:18:05 +0100 (MET) 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 NAA05522 for ; Fri, 19 Feb 1999 13:31:16 +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.8.7/8.8.7) with ESMTP id NAA04448 for ; Fri, 19 Feb 1999 13:31:09 +0100 (MET) Received: from localhost (safran.kurims.kyoto-u.ac.jp [130.54.16.91]) by kurims.kurims.kyoto-u.ac.jp (8.9.1a/3.7W) with ESMTP id VAA29276 for ; Fri, 19 Feb 1999 21:31:10 +0900 (JST) To: caml-list@inria.fr Subject: Warnings in ocaml X-Mailer: Mew version 1.93 on Emacs 20.3 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990219213015B.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 19 Feb 1999 21:30:15 +0900 From: Jacques GARRIGUE X-Dispatcher: imput version 980905(IM100) Content-Transfer-Encoding: 7bit Sender: weis I have a few comments about new warnings in ocaml. * having a warning when a function doesn't return unit in a sequence may catch some bugs, but this is a pain with imperative programming style, where you may not be interested by the result of a function but just by its side-effects. Of course you can switch off the warning, but I'm not sure having it on is a good default, since the default mode should be normative. ex. wrong code x = 3; ... ^ should be <- ex. right code f x y; ... where f: t1 -> t2 -> int has some interesting side-effect. * another common error with imperative code is partial application in a toplevel call inside a module let _ = somefunc hsj hjfhfd somefunc takes 3 arguments but is only given 2. Since this is a let-definition no warning is printed while such a partial application is pretty meaningless. Regards, Jacques --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG