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

Bengt Kleberg <>
Fri Mar 9 08:47:48 CET 2007


On 2007-03-09 08:22, Ulf Wiger wrote:

> My suggestion was to improve the ram_file_server, so that you
> could take a string representation of code, open it as a ram
> file, and then use any tool that can operate on a file
> descriptor (which epp_dodger can, but epp can't).

inspired by string ports i have written a string_io module that allows 
you to

{ok, IO} = string_io:open( "a number: 10", [read, write]),
"a" = io:get_chars( IO, '', 1),
io:fwrite(IO, "-" ),
10 = io:fread( IO, '', "number: ~d" ),
string_io:close( IO ).

etc.

works with epp_dodger.

presumably an improved ram_file_server would be better, but i like the 
concept of string ports.


bengt
-- 
Those were the days...
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."



More information about the erlang-questions mailing list