caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Yaron Minsky" <yminsky@cs.cornell.edu>
To: "Joel Reymont" <joelr1@gmail.com>
Cc: "Jonathan Bryant" <jtbryant@valdosta.edu>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] camlp4 and class introspection
Date: Sun, 10 Jun 2007 16:02:39 -0400	[thread overview]
Message-ID: <891bd3390706101302h443da391x9a4bef15da9c730f@mail.gmail.com> (raw)
In-Reply-To: <7C9995D9-AC11-4E7C-8477-25CA4B88A0F4@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

I actually think you can do this kind of thing with a combination of
type-directed programming and macros.  A similar kind of introspection-like
capabilities is achieved with the s-expression macros that we've released.
You would need to apply your macros to every type referenced by your
objects, not just to the object definitions themselves (otherwise, how is
the system to know that the value of type [foo] you refer to somewhere in
your object is really defined as [int * int] somewhere else?)

y

On 6/10/07, Joel Reymont <joelr1@gmail.com> wrote:
>
>
> On Jun 10, 2007, at 1:14 AM, Jonathan Bryant wrote:
>
> > I don't think this would be possible since CamlP4 happens before
> > type inference and therefore knows nothing about types.
>
> That's really too bad. I was thinking of recognizing that type X was
> used for instance variables, for example, and generating code to
> register these appropriately with the Objective-C runtime.
>
> I guess I could build a standalone tool to process OCaml class
> definitions and do this but I would rather have it as part of the
> regular compilation workflow.
>
> So, in a word, there's no way to achieve what I'm looking for?
> Haskell people do this using Template Haskell and Camlp4 provides
> very similar capabilities.
>
>         Thanks, Joel
>
> --
> http://topdog.cc      - EasyLanguage to C# translator
> http://wagerlabs.com  - Blog
>
>
>
>
>
> _______________________________________________
> 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
>

[-- Attachment #2: Type: text/html, Size: 2444 bytes --]

  reply	other threads:[~2007-06-10 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-09 22:59 Joel Reymont
2007-06-10  0:14 ` [Caml-list] " Jonathan Bryant
2007-06-10 12:30   ` Joel Reymont
2007-06-10 20:02     ` Yaron Minsky [this message]
2007-06-10 21:18       ` Joel Reymont
2007-06-10 22:07         ` Yaron Minsky
2007-06-11  0:58     ` Jacques GARRIGUE
2007-06-11  8:05       ` Joel Reymont
2007-06-11 10:11         ` Martin Jambon
2007-06-11 10:16           ` Joel Reymont
2007-06-11 11:36             ` Martin Jambon

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=891bd3390706101302h443da391x9a4bef15da9c730f@mail.gmail.com \
    --to=yminsky@cs.cornell.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=joelr1@gmail.com \
    --cc=jtbryant@valdosta.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).