[erlang-questions] dynamic module compilation

Howard Yeh <>
Sun Jun 8 18:45:33 CEST 2008


see ERTS manual chapter 4 to see the abstract format.

http://www.erlang.org/doc/apps/erts/part_frame.html

there's also Core Erlang. But I am not sure where it's documented.


On 6/8/08, Robert Virding <> wrote:
> There are basically two ways of doing this:
>
> - From you list of files generate a file, grammar.erl, containing the module
> grammar with functions adjectives/0 and nouns/0. You then compile with
> compile:file and load with code:load.
>
> - You can generate the code as AST in memory and then compile with
> compile:forms. This is a bit tricky the first time, but easy once you get
> the hang of it.
>
> - As someone else mentioned save them in a database on disk.
>
> Robert
>
> 2008/6/8 Jacob Perkins <>:
> > Hi all,
> >
> >
> >
> > I need some help understanding how to dynamically compile/generate an
> erlang module. I've seen other projects do this kind of thing, such as
> erlydtl, but my needs are much simpler.
> >
> >
> > I have a few files that are basically lists of words. What I want to do is
> generate a module whose functions will return each list of words. So if I
> have two files named "adjectives" and "nouns", then the generated module
> (let's call it 'grammar') should have two functions, adjectives() and
> nouns(), that return their respective list of words.
> >
> >
> > How can I do this?
> >
> >
> > Thanks,
> > Jacob
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
>
>
> _______________________________________________
>  erlang-questions mailing list
>  
>  http://www.erlang.org/mailman/listinfo/erlang-questions
>


-- 
hayeah.wordpress.com
   --metacircular thinking



More information about the erlang-questions mailing list