Version française
Home     About     Download     Resources     Contact us    
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

expr:
[
	[ "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 ?

tnx,
p

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

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners