Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] camlp4 and eval...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pietro Abate <Pietro.Abate@a...>
Subject: [Caml-list] camlp4 and eval...
Hi all,
I'm trying to write a a cp4 extension that evals and use a
parsed value during the parsing process... in symbols my problem
looks like :

let h = Hashtbl.create 10
let store l = Hashtbl.add h l

	[ "keyword"; e = expr ->
		let e' = EVAL_MAGIC_FUNCTION e in
		let _ = store e' in
		<:expr<other_function $e$>>

I don't want to write something like "["; e = LIST1 int SEP ";"; "]"
because I want to maintain the flexibility to accept a function or a
LIDENT instead that hard wired a list definition...

what's the magic function that gives me back an expression that I can
use in the extension context ? Does this function exist or I'm mixing
everything again ?


Civilization advances by extending the number
of important operations which we can perform 
without thinking. (Alfred North Whitehead)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: