caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: padiolea@irisa.fr
To: "Jonathan Roewen" <jonathan.roewen@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] C++ templates to OCaml
Date: Sun, 19 Jun 2005 20:05:38 +0200 (CEST)	[thread overview]
Message-ID: <49293.62.147.45.218.1119204338.squirrel@mail.irisa.fr> (raw)
In-Reply-To: <ad8cfe7e05061823535934e9c@mail.gmail.com>

> Hi,
>
> What's the best way to imitate C++ templates in OCaml?

Well, simply use polymorphic types and functions.

> I have some
> code that makes extensive use of templates that I want to rewrite in
> OCaml, and using record types and functions is getting messy, and a
> lot more convoluted than the C++ code.
>
> Are objects the way to go here? And if so, can someone give me a
> simple example of how this would work?

read the ocaml manual,  or code in list.ml for instance in the
ocaml standard library.

> Jonathan
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


  parent reply	other threads:[~2005-06-19 18:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-19  6:53 Jonathan Roewen
2005-06-19 13:17 ` Jacques Carette
2005-06-19 18:05 ` padiolea [this message]
     [not found] ` <1119175572.7402.1.camel@titania>
2005-06-19 21:32   ` Jonathan Roewen
2005-06-19 22:34     ` Benjamin Geer
2005-06-20  2:53 ` Brian Hurt

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=49293.62.147.45.218.1119204338.squirrel@mail.irisa.fr \
    --to=padiolea@irisa.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.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;
as well as URLs for NNTP newsgroup(s).