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: ONCE construct
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: jehenrik <jehenrik@y...>
Subject: Re: [Caml-list] camlp4: ONCE construct
> See an article by Francois Pottier at
> for (almost direct) answer.

Well, for my original question, consider the choice of regular 
expression compilation to be an arbitrary task.  The only point is that 
it be computationally expensive.  I have wanted the same thing in 
completely different contexts.

Jeff Henrikson

jehenrik> Hi,
jehenrik> I would like to write a Camlp4 construct which causes its 
argument to
jehenrik> only be evaluated once.  Eg:

jehenrik> ...
jehenrik> 	...
jehenrik> 		...
jehenrik> 			ONCE Pcre.regexp "([0-9]+)"

jehenrik> would be transformed to:

jehenrik> let gensym000 = Pcre.regexp "([0-9]+)";;
jehenrik> ...
jehenrik> 	...
jehenrik> 		...
jehenrik> 			gensym000

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