caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Thomas Gazagnaire <ocaml@gazagnaire.com>
Cc: OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] annotate a .ml file with type information
Date: Wed, 19 Nov 2008 17:42:45 +0000	[thread overview]
Message-ID: <20081119174245.GB10376@annexia.org> (raw)
In-Reply-To: <9722eaea0811190632l66a36f2cge1cbf7fdee5d3044@mail.gmail.com>

On Wed, Nov 19, 2008 at 02:32:09PM +0000, Thomas Gazagnaire wrote:
> I would like to write a camlp4 extension which use infered-type information.
> To do that, I can see two ways:
> * either calling an type-inference function of the compiler, giving it an
> AST and a context associating identifiers to types which seems to me a bit
> complicated (and maybe impossible),

IIRC this isn't possible from a camlp4 extension, partly because you
can't call into the compiler like this, but mainly because at this
stage in compilation you haven't even looked up which symbols come
from which modules.  You can't do that lookup because you don't have
access to the command line (eg. the -I arguments), and anyway it'd be
really hairy to try even if you did.

> * or annotating the original source code with infered-type information -
> which seems to me simpler. In this case, I believe that it is not difficult
> to merge an ml file and its corresponding .annot file to produce a file
> where every identifier is type annotated,[...]

I'm sure that merging the .annot & .ml files together is going to be
the easiest way.

Rich.

-- 
Richard Jones
Red Hat


      reply	other threads:[~2008-11-19 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19 14:32 Thomas Gazagnaire
2008-11-19 17:42 ` Richard Jones [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=20081119174245.GB10376@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=ocaml@gazagnaire.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).