caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Alexander S. Usov" <A.S.Usov@KVI.nl>
To: Michael Vanier <mvanier@cs.caltech.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] extensible records?
Date: Fri, 27 Feb 2004 12:17:41 +0100	[thread overview]
Message-ID: <200402271136.37410.A.S.Usov@kvi.nl> (raw)
In-Reply-To: <20040227004557.C85CE9BBA2@orchestra.cs.caltech.edu>

On Friday 27 February 2004 01:45, you wrote:
> Hi everyone!
>
> I'm having a problem figuring out how to implement something in ocaml, and
> I'd like to solicit advice.  I'm writing a little dynamically-typed
> language in ocaml, and I want to be able to add new types to the language
> without having to add new primitive types to the system.  So, for instance,
> my basic type definition looks something like this:
>
>     type data =
>         Int of int
>
>       | Float of float
>       | ...
>
> Mike

I am not hundred percent sure, but you can use parametrized definition.
Like this:

type 'a data =
	Int of int
	| Float of float
	| .....
	| Extension of 'a ;;

-- 
Best regards,
  Alexander.

-------------------
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 11:17 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
2004-02-27 11:17 ` Alexander S. Usov [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=200402271136.37410.A.S.Usov@kvi.nl \
    --to=a.s.usov@kvi.nl \
    --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).