From: briand@aracnet.com
To: brogoff <brogoff@speakeasy.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] duplicate record labels and modules
Date: Tue, 11 May 2004 11:15:17 -0700 [thread overview]
Message-ID: <16545.6197.680705.27513@soggy.deldotd.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0405110953160.20883@shell2.speakeasy.net>
>>>>> "brogoff" == brogoff <brogoff@speakeasy.net> writes:
brogoff> On Tue, 11 May 2004 briand@aracnet.com wrote:
>> That's useful. I need to read the chapter on language extensions
>> more closely.
brogoff> Also, here's the requisite RTFM (I mean that F in the
brogoff> nicest possible way ;)
brogoff> http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#labels_surcharge
I Just found it.
It should have occurred to me that this subject would be an FAQ.
However, my original question was more about the syntax of making
using modules to separate the field name less typing-ful :-)
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 ?
brogoff> IMO, it's inconvenient, and a drawback to the language, but
brogoff> not a kludge, or even a mistake. I reserve that for the
brogoff> undefined order of evaluation :-). Oh well, you didn't
brogoff> expect paradise, did you?
>> I'm assuming the right way is to use modules, which is what
>> started this whole exercise for me.
brogoff> If you must share field names in the same module, your only
brogoff> alternative is to use the OO part of Ocaml. That's
brogoff> unfortunate, because I think objects are a bit heavyweight
brogoff> for things like points and segments in a computational
brogoff> geometry program. OTOH, Ocaml's object system is quite
brogoff> powerful and principled (and sometimes complex and
brogoff> unintuitive!) compared to lesser languages like C++ and
brogoff> Java. I often think a class system like CLOS or Dylan's
brogoff> would be more to my liking, but hard to reconcile with
brogoff> ststic typing and modules.
I do _not_ need to use the same field name in the same module.
So using modules is the right way and what I will do.
For my current application objects are, as you say, too heavyweight.
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
prev parent reply other threads:[~2004-05-11 18:15 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
2004-05-11 18:15 ` briand [this message]
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=16545.6197.680705.27513@soggy.deldotd.com \
--to=briand@aracnet.com \
--cc=brogoff@speakeasy.net \
--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