caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Cannasse" <warplayer@free.fr>
To: "Michael Vanier" <mvanier@cs.caltech.edu>, <caml-list@inria.fr>
Subject: Re: [Caml-list] extensible records?
Date: Fri, 27 Feb 2004 09:39:59 +0100	[thread overview]
Message-ID: <002e01c3fd0d$4979b120$ef01a8c0@warp> (raw)
In-Reply-To: <20040227004557.C85CE9BBA2@orchestra.cs.caltech.edu>

[...]
> I thought of using polymorphic variant types, but my (limited)
understanding
> is that you either declare all possible variants straight up in the .mli
file
> (which totally defeats my purpose) or you don't declare anything and let
the
> compiler infer the type (which I don't know how to write into a .mli
file).
> If this can be done with polymorphic variants, how would I do it?
> Alternatively, if this can be done with objects, how would I do it?  Or
> should I just stick with abusing exceptions?

There is a nice paper from Jacques Garrigue about extensions using
polymorphic variants.
"Code reuse through polymorphic variants. "
http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/papers/
That might be what you're loooking for.

Regards,
Nicolas Cannasse

-------------------
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


  parent reply	other threads:[~2004-02-27  8:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27  0:45 Michael Vanier
2004-02-27  1:04 ` Kenneth Knowles
2004-02-27  8:39 ` Aleksey Nogin
2004-02-27  8:39 ` Nicolas Cannasse [this message]
2004-02-27 11:17 ` Alexander S. Usov

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='002e01c3fd0d$4979b120$ef01a8c0@warp' \
    --to=warplayer@free.fr \
    --cc=caml-list@inria.fr \
    --cc=mvanier@cs.caltech.edu \
    /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).