metaprogramming
Literal XML in Erlang with parse_transform/2
Posted June 26th, 2007 by bardOne of the things I dislike about Erlang is that it severely impairs bragging opportunities. Yesterday I wrote a module that allows writing literal XML in the source and have it parsed into Erlang structures at compile time—sort of like E4X minus the manipulation goodies at runtime (at least for now).
You write:
Doc = '<greeting>Hello!</greeting>',
io:format("~p~n", [Doc]).
And it prints…
Comments
7 weeks 6 days ago
8 weeks 4 days ago
9 weeks 1 day ago
9 weeks 2 days ago
9 weeks 4 days ago
10 weeks 39 min ago
10 weeks 11 hours ago
10 weeks 2 days ago
10 weeks 2 days ago
11 weeks 2 days ago