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 KAA31348; Sun, 29 Apr 2001 10:19:50 +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 KAA31318 for ; Sun, 29 Apr 2001 10:19:49 +0200 (MET DST) Received: from ontil.ihep.su (ontil.ihep.su [194.190.161.63]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f3T8JlH08680 for ; Sun, 29 Apr 2001 10:19:48 +0200 (MET DST) Received: from localhost (vsl@localhost) by ontil.ihep.su (8.11.0/8.11.0) with ESMTP id f3T8FOj13671; Sun, 29 Apr 2001 12:15:25 +0400 Date: Sun, 29 Apr 2001 12:15:24 +0400 (MSD) From: Vitaly Lugovsky To: Pixel cc: Subject: Re: [Caml-list] unused variables warning In-Reply-To: <20010428095737.206C55722@leia.mandrakesoft.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 28 Apr 2001, Pixel wrote: > Is there any way to ask ocamlc for an "unused variable" warning? > > let f x = > let x' = <...> in > x > > would issue something like > > File "test.ml", line 2, characters 3-18: > Unused variable x' It's "unused" and can be optimized out only when <...> is a pure functional statement (not changing global state). There is no clean way to figure this out, since we can use foreign functions, and "purity" is not specified in a module signature. 'tis a very interesting suggestion: specify pure functional and state-changing functions in signatures (automaticaly or manualy), and use this info for a better optimizations. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr