Browse thread
camlp4 & free variables
- Christophe TROESTLER
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-07-19 (23:27) |
From: | Christophe TROESTLER <Christophe.Troestler@u...> |
Subject: | camlp4 & free variables |
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