caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: yminsky@gmail.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Record field disambiguation in 4.01
Date: Mon, 11 Mar 2013 12:52:53 +0100	[thread overview]
Message-ID: <513DC595.9020006@frisch.fr> (raw)
In-Reply-To: <CADKNfhKDC-EwsKkjZ+uqbary5Cy48k=+J_GX4dzAMCi5v0hsNg@mail.gmail.com>

On 03/10/2013 12:39 AM, Yaron Minsky wrote:
> Also, I'm wondering if anyone has thoughts as to how much code this
> change will break?  The answer might be "quite a lot", and it might
> nonetheless be worth it.  But I'm curious what people's thoughts are.

As Jacques said, this is only a warning, which is turned off by default. 
  I expect that all the "unused stuff" warnings also broke most code 
bases around which are compiled with "-w +A -warn-error A".  I'm sure 
you are not suggesting that new warnings should never be triggered on 
code which used to be well-typed by a previous version of the compiler...

The warning tells you something useful: with that record type 
declaration, the reference to field "y" becomes ambiguous, which means 
in particular that (i) your code might become fragile w.r.t. reordering 
of type declarations, (ii) the code might become harder to read (the 
reader might expect that field "y" is typically related to a different 
record type in your code base).  Of course, a more explicit warning 
message, as you suggest, would be even better.

During the discussion on type-based disambiguation, Mark Shinwell 
commented that most record types in JS code base are defined in nested 
modules (and often exposed only through builder functions) to avoid 
label clashes.  Is your example an instance where this is not the case?


Alain

  parent reply	other threads:[~2013-03-11 11:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09 23:39 Yaron Minsky
2013-03-10  1:24 ` Jacques Garrigue
2013-03-11 11:38   ` Maxence Guesdon
2013-03-12  7:57     ` Alain Frisch
2013-03-10  3:04 ` Markus Mottl
2013-03-10  9:33   ` Gabriel Scherer
2013-03-11 10:31     ` Goswin von Brederlow
2013-03-12 11:30       ` Leo White
2013-03-11 18:49   ` Yaron Minsky
2013-03-11 11:52 ` Alain Frisch [this message]
2013-03-11 18:52   ` Yaron Minsky
2013-03-12  8:05     ` Alain Frisch
2013-03-12 15:05     ` Jacques Garrigue
2013-03-12 15:29       ` Jacques Carette
2013-03-12 17:07         ` Gabriel Scherer
2013-03-12 20:42           ` Jacques Garrigue

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=513DC595.9020006@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    --cc=yminsky@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).