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 LAA32028; Sun, 29 Apr 2001 11:58:24 +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 LAA31994 for ; Sun, 29 Apr 2001 11:58:23 +0200 (MET DST) Received: from leia.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3T9wMP00657 for ; Sun, 29 Apr 2001 11:58:22 +0200 (MET DST) Received: by leia.mandrakesoft.com (Postfix, from userid 505) id 5E8185725; Sun, 29 Apr 2001 11:58:22 +0200 (CEST) To: Vitaly Lugovsky Cc: Subject: Re: [Caml-list] unused variables warning References: From: Pixel In-Reply-To: Vitaly Lugovsky's message of "Sun, 29 Apr 2001 12:15:24 +0400 (MSD)" User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-Id: <20010429095822.5E8185725@leia.mandrakesoft.com> Date: Sun, 29 Apr 2001 11:58:22 +0200 (CEST) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Vitaly Lugovsky writes: [...] > > 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). even if the <...> is unpure, caml could warn that x' is unused. It doesn't mean in any way that computing x' is unnecessary. and caml should not warn for let _x' = <...> in > 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. that would be cool, but it's much more complicated than my simple suggestion :) cu Pixel. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr