Pluggable syntax transformations (was Re: Erlang vs. Java)

Thomas Lindgren <>
Fri Sep 9 10:42:04 CEST 2005



--- Joel Reymont <> 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
examples.

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
pretty useful.)

Best,
Thomas



	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/



More information about the erlang-questions mailing list