Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] unused variables warning
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-29 (08:19)
From: Vitaly Lugovsky <vsl@o...>
Subject: Re: [Caml-list] unused variables warning
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 "", 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  Archives: