Pluggable syntax transformations (was Re: Erlang vs. Java)
Fri Sep 9 10:42:04 CEST 2005
--- Joel Reymont <joelr1@REDACTED> wrote:
> Care to post some examples?
These transformations are known as "parse transforms".
Basically, you get the parsed syntax trees of the
module as inputs, and emit a collection of syntax
trees as output (ie, feed them to the rest of the
compiler). In OTP, you have sys_pre_attributes,
mnemosyne, qlc, ms_transform and perhaps others as
erl_id_trans.erl also has a simple template for
writing parse transforms.
(I would say Lisp macros are above and ahead of what
Erlang offers today. But parse transforms can still be
Click here to donate to the Hurricane Katrina relief effort.
More information about the erlang-questions