caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Erik de Castro Lopo <ocaml-erikd@mega-nerd.com>
To: caml-list@inria.fr
Subject: Syntax for partial copy of struct member
Date: Sun, 11 Jun 2006 14:35:43 +1000	[thread overview]
Message-ID: <20060611143543.79e8d4eb.ocaml-erikd@mega-nerd.com> (raw)

Hi all,

There's something in Ocaml that allows me to have a struct
defined as:

    type struct_t = { a : int ; b : int ; c : int }

and an instance of that say:

    let x = { a = 1 ; b = 2 ; c = 3 }

and then have:

    let y = { a = 2 ; (* b and c filled in from x *) }

but I can't for the life of me remember the syntax. Anyone care
to give me a gentle tap with the clue bat?

Thanks,
Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"Death is perhaps too easy" -- Iqbal Sacranie in 1989 about
Salman Rushdie, author of "The Satanic Verses". Sacranie 
received a knighthood in 2005 as the face of 'moderate'
British Islam. He has never disowned his earlier statement.


             reply	other threads:[~2006-06-11  4:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-11  4:35 Erik de Castro Lopo [this message]
2006-06-11  4:46 ` Erik de Castro Lopo

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=20060611143543.79e8d4eb.ocaml-erikd@mega-nerd.com \
    --to=ocaml-erikd@mega-nerd.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).