caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe TROESTLER <Christophe.Troestler@umh.ac.be>
To: "O'Caml Mailing List" <caml-list@inria.fr>
Subject: camlp4 & free variables
Date: Thu, 20 Jul 2006 01:27:06 +0200 (CEST)	[thread overview]
Message-ID: <20060720.012706.109316902.Christophe.Troestler@umh.ac.be> (raw)

Hi,

Is it possible to write a camlp4 syntax extension that "extract" the
free variables of an expression?  As an example, say I write

  FUNCTION(let z = x + 2 in x + 2 * y * x * z)

and it becomes

  fun ~x ~y -> let z = x + 2 in x + 2 * y * x * z

(of course I'd like good error reporting in case of an error in the
expression).  If it is not possible, what is the best way to build a
tool that does that (short of writing a parser for the OCaml language)?

Thanks,
ChriS


             reply	other threads:[~2006-07-19 23:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-19 23:27 Christophe TROESTLER [this message]
2006-07-20  8:28 ` [Caml-list] " Nicolas Pouillard
     [not found]   ` <20060720.163930.91910937.Christophe.Troestler@umh.ac.be>
2006-07-21 12:01     ` Nicolas Pouillard
2006-07-21 18:16       ` Martin Jambon
2006-07-20  9:25 ` Guido Kollerie
2006-07-20  9:25 ` Guido Kollerie
2006-07-20 10:25   ` Accidentally bounced my email [Was: [Caml-list] camlp4 & free variables] Guido Kollerie
2006-07-20  9:25 ` [Caml-list] camlp4 & free variables Guido Kollerie

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=20060720.012706.109316902.Christophe.Troestler@umh.ac.be \
    --to=christophe.troestler@umh.ac.be \
    --cc=caml-list@inria.fr \
    /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).