Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jim Farrand <jim.farrand@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Value shadowing
Date: Wed, 13 Aug 2008 11:33:23 +0100	[thread overview]
Message-ID: <20080813113323.7897b9b3@corvus.office.mcom> (raw)
In-Reply-To: <7C6C7ADD-910D-4C62-92FF-E286F0817FA1@cs.berkeley.edu>

On Wed, 13 Aug 2008 02:15:53 -0700
Brighten Godfrey <pbg@cs.berkeley.edu> wrote:

> I also find that style useful.  Sometimes the type changes, but I
> can recall useful cases where the type doesn't change, e.g., a
> sequence of various operations on a list.  Mock-up:
> 
>      let lst = generate_list_somehow () in
>      let lst = List.filter (fun x -> x > 0) in
>      let lst = List.sort compare lst in

Agreed.

I have a slightly different proposal than using return types: short
pragmas for switching off specific instances of a warning.

I always want as many warnings as possible switched on because I find
them really useful.  The problem is they are warnings for a reason:
They don't ALWAYS represent errors.

Once my code has a warning in it, the usefulness of warnings is greatly
reduced as I'm less likely to spot the addition of another warning in
the compiler output.

If I could disable specific instances of a warning, which I've looked
at and decided to ignore, I'd get the best of both worlds.

>      (* @disableshadowwarning *)
>      let lst = generate_list_somehow () in
>      let lst = List.filter (fun x -> x > 0) in
>      let lst = List.sort compare lst in
>      (* @enableshadowwarning *)

No doubt, someone can think of a better syntax

Regards,
Jim


  parent reply	other threads:[~2008-08-13 10:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  8:54 David Allsopp
2008-08-13  9:15 ` [Caml-list] " Brighten Godfrey
2008-08-13  9:56   ` David Allsopp
2008-08-13 10:49     ` [Caml-list] Value shadowing (tangent) Brighten Godfrey
2008-08-13 11:04       ` David Allsopp
2008-08-13 11:04       ` Brighten Godfrey
2008-08-13 11:17         ` Daniel Bünzli
2008-08-13 23:05           ` Stefano Zacchiroli
2008-08-13 23:33             ` Daniel Bünzli
2008-08-13 11:05       ` Vincent Hanquez
2008-08-16 20:02         ` Pierre Etchemaïté
2008-08-17  8:07           ` David Allsopp
2008-08-17 10:28             ` Pierre Etchemaïté
2008-08-13 10:33   ` Jim Farrand [this message]
2008-08-13 10:12 ` [Caml-list] Value shadowing Richard Jones
2008-08-13 11:04   ` David Allsopp
2008-08-13 12:26     ` blue storm
2008-08-13 15:03     ` Mauricio Fernandez
2008-08-13 11:50 ` blue storm

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=20080813113323.7897b9b3@corvus.office.mcom \
    --to=jim.farrand@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /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