[erlang-questions] erl_syntax: Module import statement
XCentric
xcentricity@REDACTED
Thu Dec 3 19:35:51 CET 2009
Many thanks, Richard.
Regards,
AR
On Thu, Dec 3, 2009 at 9:02 PM, Richard Carlsson <richardc@REDACTED> wrote:
> XCentric wrote:
> > Hi!
> >
> > Could anyone please give me an example of how to use
> erl_syntax:attribute/2
> > to generate AST for a module import statement? For example, how to
> represent
> > "-import(io)." using erl_syntax:attribute/2?
>
> Like this:
>
> 1> A = erl_syntax:attribute(erl_syntax:atom(import),
> [erl_syntax:atom(io)]).
> 2> io:put_chars(erl_prettypr:format(A)).
> -import(io).ok
>
>
> /Richard
>
More information about the erlang-questions
mailing list