From: Christophe Raffalli <raffalli@univ-savoie.fr>
To: caml-list@inria.fr
Subject: [Caml-list] Record with one non mutable filed
Date: 30 Jul 2002 09:48:07 +0200 [thread overview]
Message-ID: <1028015288.2026.5.camel@boris.univ-savoie.fr> (raw)
In-Reply-To: <20020729144527.A30919@pauillac.inria.fr>
How are compiled record with only one non mutable field ? are they
removed ?
In Ocaml 3.05, record with only one non mutable field may be used in the
following way:
type 'a foo =
A of int
| B of 'a
type bar = { value : 'a.'a foo }
this means that type bar is somehow a subtype of type foo (constructor B
being removed.
then I think (but may be wrong) that an expression as
let b = { value = A 3 } could be compiled as
let b = A 3
Is this optimization performed ? (I know this is not very important for
efficiency ... but I am just curious)
--
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex
tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
-------------------
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
next prev parent reply other threads:[~2002-07-30 22:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-29 12:45 [Caml-list] OCaml 3.05 released Xavier Leroy
2002-07-29 14:36 ` Nicolas Cannasse
2002-07-30 0:46 ` Shawn Wagner
2002-07-30 3:50 ` Scott J.
2002-07-30 7:34 ` John Prevost
2002-07-30 7:46 ` [Caml-list] Serious typechecking error involving new polymorphism (crash) John Prevost
2002-07-30 7:58 ` Xavier Leroy
2002-07-30 8:22 ` John Prevost
2002-07-30 8:47 ` Xavier Leroy
2002-07-30 8:37 ` Sven LUTHER
2002-07-30 14:11 ` [Caml-list] bug-fix branches Xavier Leroy
2002-07-30 16:15 ` Sven LUTHER
2002-08-01 9:37 ` [Caml-list] 3.05 and future 3.06 binary compatibility ? root
2002-08-01 12:09 ` [Caml-list] " Xavier Leroy
2002-08-01 15:56 ` Sven LUTHER
2002-08-08 8:37 ` Sven LUTHER
2002-08-09 12:25 ` Xavier Leroy
2002-08-09 13:16 ` Sven LUTHER
2002-07-30 7:51 ` [Caml-list] OCaml 3.05 released Dmitry Bely
2002-07-30 15:01 ` Scott J.
2002-07-30 15:11 ` Dmitry Bely
2002-08-02 5:31 ` Jacques Garrigue
2002-08-02 11:15 ` Tim Freeman
2002-07-30 7:48 ` Christophe Raffalli [this message]
2002-07-30 11:49 ` Yaron M. Minsky
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=1028015288.2026.5.camel@boris.univ-savoie.fr \
--to=raffalli@univ-savoie.fr \
--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