Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe TROESTLER <Christophe.Troestler+ocaml@umh.ac.be>
To: yitzhak@research.att.com
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] "opening" record types
Date: Tue, 21 Aug 2007 15:42:36 +0200 (CEST)	[thread overview]
Message-ID: <20070821.154236.68145619.Christophe.Troestler+ocaml@umh.ac.be> (raw)
In-Reply-To: <67ECB685-E69A-43CA-867D-30B879DB0510@research.att.com>

On Tue, 21 Aug 2007 09:18:02 -0400, Yitzhak Mandelbaum wrote:
> 
> let y = {Foo.a=3; Foo.b=4}
> 
> Is there any way around this?  That is, is there any way to use the  
> field names of a record defined in another module without opening the  
> whole module or copying the whole definition of the record.

No because the record {a,b} may also be defined in another module and
you need to tell which one to use.  However, you can put the
qualification only once :

let y = {Foo.a=3; b=4}

Of course, if [Foo] name is long, you can alias it at the beginning of
your code :

module F = Very.Long.Module.Name

Cheers,
ChriS


  parent reply	other threads:[~2007-08-21 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 13:18 Yitzhak Mandelbaum
2007-08-21 13:34 ` [Caml-list] " Olivier Andrieu
2007-08-21 22:19   ` Yaron Minsky
2007-08-21 13:42 ` Christophe TROESTLER [this message]
2007-08-21 13:55   ` Daniel de Rauglaudre
2007-08-21 13:47 ` Virgile Prevosto
2007-08-22 16:32 ` Philippe Wang
2007-08-22 19:24   ` Jeremy Yallop

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=20070821.154236.68145619.Christophe.Troestler+ocaml@umh.ac.be \
    --to=christophe.troestler+ocaml@umh.ac.be \
    --cc=caml-list@yquem.inria.fr \
    --cc=yitzhak@research.att.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