caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <weis@pauillac.inria.fr>
To: bpr@best.com (Brian Rogoff)
Cc: caml-list@pauillac.inria.fr
Subject: Re: Same label in different types, how do people solve this?
Date: Mon, 11 Dec 2000 18:19:47 +0100 (MET)	[thread overview]
Message-ID: <200012111719.SAA00581@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.BSF.4.21.0012080834310.6785-100000@shell5.ba.best.com> from Brian Rogoff at "Dec 8, 100 08:36:08 am"

> Mattias Waldau wrote : 
> > In Ocaml, you cannot have the same label in different types, see the
> example
> > below where point_2d hides point_3d.
> 
> Troublemaker :-). There is a thread on this topic on comp.lang.functional. 
> Please, FAQ maintainer, this is very definitely FAQ material!

Feel free to propose an entry for the FAQ (in english and french
please): I would be glad to add it.

[...]
> Pierre Weis wrote
> > I would suggest another syntactic notation to specify the type to
> > which a label belongs: label@@type.
> > 
> > {x@@p2d = 0; y = 5}
> > r.x@@p2d
> 
> I don't want to start a syntax war, but I think Ocaml is already suffering
> a bit from too much added syntax and this doesn't look good to me. Jacques' 
> reuse of ":" (I know, it applies to the whole record and not a label) is 
> easier on my eyes, which already associate ":" with typing. 
> 
> -- Brian

The notation I suggested is simpler to implement and specify: there is
nothing new in type constraints propagation and label overloaing
resolution strategy: just a notation to specify the type to which a
label or constructor belongs to in the same spirit as usual
qualification of names in the module system.

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/




  reply	other threads:[~2000-12-11 17:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-06 21:22 Mattias Waldau
2000-12-07 16:49 ` John Max Skaller
2000-12-07 18:34 ` Maxence Guesdon
2000-12-07 23:02 ` Gerd Stolpmann
2000-12-08  1:22 ` Jacques Garrigue
2000-12-08  9:31   ` Sven LUTHER
2000-12-08  9:36     ` Pierre Weis
2000-12-08  9:48       ` Sven LUTHER
2000-12-08 18:41       ` John Max Skaller
2000-12-08  9:40     ` Nicolas barnier
2000-12-08 16:36 ` Brian Rogoff
2000-12-11 17:19   ` Pierre Weis [this message]
2000-12-10 12:49 ` Mattias Waldau
2000-12-11 18:23   ` Chris Hecker
2000-12-11 19:17     ` Pierre Weis
2000-12-12 10:02       ` Sven LUTHER
2000-12-12  3:25     ` Chet Murthy
2000-12-12 17:43       ` John Max Skaller
2000-12-12 19:24         ` Functions must be explicitly typed, (was Same label in different types, how do people solve this?) Mattias Waldau
2000-12-13  0:51           ` John Max Skaller
2000-12-15 10:13             ` Andreas Rossberg
2000-12-15 12:50             ` Frank Atanassow
2000-12-14 18:42           ` Stefan Monnier
2000-12-15 12:47             ` Pierre Weis
2000-12-15 13:39               ` Mattias Waldau
2000-12-15 23:37                 ` Brian Rogoff
2000-12-16 14:10                 ` ROverloading John Max Skaller
2000-12-15 21:51         ` Same label in different types, how do people solve this? Bruce Hoult
2000-12-12 17:19   ` John Max Skaller
2000-12-10 14:57 Ohad Rodeh
2000-12-13 13:17 Dave Berry
2000-12-13 14:31 ` Mattias Waldau
2000-12-15 10:01   ` John Max Skaller

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=200012111719.SAA00581@pauillac.inria.fr \
    --to=weis@pauillac.inria.fr \
    --cc=bpr@best.com \
    --cc=caml-list@pauillac.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;
as well as URLs for NNTP newsgroup(s).