[erlang-questions] compile module from string, containing macro definitions

Robert Virding robert.virding@REDACTED
Fri Mar 9 02:17:50 CET 2007

Chris Newcombe wrote:
>> Does anybody know how to get compile:forms to process -include
>> directives, or if I need to do it myself as a pre-pass?
> To answer my own question, a glance at epp.erl shows that include
> files are handled there.  So I guess I'll have to duplicate the
> support.
> It's a shame that the preprocessor & compiler are almost-but-not-quite
> packaged in a way that makes them usable from within applications.

Of course the easiest solution to all this is to modify epp, the 
preprocessor, to read from a file. I haven't really considered the 
problem before now as the only times I have looked at generating code on 
the fly as strings it has been "preprocessed".

I suppose it wouldn't be too difficult to do.


More information about the erlang-questions mailing list