compiling a module from a string

Mats Cronqvist <>
Mon Jul 10 13:40:12 CEST 2006


Ulf Wiger (AL/EAB) wrote:
>  
> MaCro = Mats Cronqvist wrote:
>>> Str = "-module(m).\n-export([foo/0]).\nfoo() -> foo.\n".
>>> compile:string(Str, [binary]).
>>    this should work iff there are no #@#$&* macros. if there 
>> is, it's pretty easy to write a subset of epp and call it 
>> between scanning and parsing.
> 
> Well, my ram_file_io_server works like a charm and lets me 
> use all the wonderful macros too.  (:
> 

   my post was mainly to inform the lurkers that it is not necessary to hack 
around in the kernel sources.
   of course, if i can save even one poor, unsuspecting soul from using macros i 
will surely get my reward in the hereafter.

   mats



More information about the erlang-questions mailing list