Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pixel <pixel@mandrakesoft.com>
To: Vitaly Lugovsky <vsl@ontil.ihep.su>
Cc: <caml-list@inria.fr>
Subject: Re: [Caml-list] unused variables warning
Date: Sun, 29 Apr 2001 11:58:22 +0200 (CEST)	[thread overview]
Message-ID: <20010429095822.5E8185725@leia.mandrakesoft.com> (raw)
In-Reply-To: Vitaly Lugovsky's message of "Sun, 29 Apr 2001 12:15:24 +0400 (MSD)"

Vitaly Lugovsky <vsl@ontil.ihep.su> 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


  reply	other threads:[~2001-04-29  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-28  9:57 Pixel
2001-04-29  8:15 ` Vitaly Lugovsky
2001-04-29  9:58   ` Pixel [this message]
2001-04-29 13:06     ` Sven LUTHER
2001-04-29 13:14       ` Pixel
2001-04-29 10:14   ` Marcin 'Qrczak' Kowalczyk
2002-09-09 21:24 ` [Caml-list] " Pixel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010429095822.5E8185725@leia.mandrakesoft.com \
    --to=pixel@mandrakesoft.com \
    --cc=caml-list@inria.fr \
    --cc=vsl@ontil.ihep.su \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox