caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: brogoff <brogoff@speakeasy.net>
To: briand@aracnet.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] duplicate record labels and modules
Date: Tue, 11 May 2004 10:46:42 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0405110953160.20883@shell2.speakeasy.net> (raw)
In-Reply-To: <16544.64275.204812.673065@soggy.deldotd.com>

On Tue, 11 May 2004 briand@aracnet.com wrote:
> That's useful.  I need to read the chapter on language extensions more
> closely.

Also, here's the requisite RTFM (I mean that F in the nicest possible way ;)

	http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#labels_surcharge

>   Ville-Pertti> Alternately, assuming the modules are your own, you
>   Ville-Pertti> can name your record fields so that opening both
>   Ville-Pertti> modules doesn't cause conflicts (e.g. using a short
>   Ville-Pertti> prefix).
>
> That's very kludgy, isn't it ?

IMO, it's inconvenient, and a drawback to the language, but not a kludge, or
even a mistake. I reserve that for the undefined order of evaluation :-).
Oh well, you didn't expect paradise, did you?

> I'm assuming the right way is to use modules, which is what started this
> whole exercise for me.

If you must share field names in the same module, your only alternative is to
use the OO part of Ocaml. That's unfortunate, because I think objects are a bit
heavyweight for things like points and segments in a computational geometry
program. OTOH, Ocaml's object system is quite powerful and principled (and
sometimes complex and unintuitive!) compared to lesser languages like C++
and Java. I often think a class system like CLOS or Dylan's would be more to my
liking, but hard to reconcile with ststic typing and modules.

-- Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-05-11 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-11  5:13 briand
2004-05-11  7:32 ` Ville-Pertti Keinonen
2004-05-11 16:10   ` briand
2004-05-11 17:46     ` brogoff [this message]
2004-05-11 18:15       ` briand

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=Pine.LNX.4.58.0405110953160.20883@shell2.speakeasy.net \
    --to=brogoff@speakeasy.net \
    --cc=briand@aracnet.com \
    --cc=caml-list@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).