compilation - what is the use of erlang compile options: "-compile({parse_transform, ms_transform})".? -
compilation - what is the use of erlang compile options: "-compile({parse_transform, ms_transform})".? -
as title, explain utilize of parse_transform ms_transform? different between , without ?
the -compile({parse_transform, ms_transform}). syntax invokes parse transform.
a parse transform module compiler calls after file or input has been parsed. module called total abstract syntax of whole module , must homecoming new abstract whole module. parse transform allowed whatever wants long result legal erlang syntax. super macro facility works on whole module not single function calls. resulting module compiled. can have many parse transforms.
parse transforms typically used compile-time evaluation , code transformations. ets:fun2ms phone call mentioned @p_a typical illustration of takes fun , @ compile-time transforms match specification, see matchspecs , ets:fun2ms. parse transforms allow much more, illustration add together , remove functions. illustration of parse transform generates access functions fields in record.
it powerful tool, unfortunately easy wrong , create real mess. there are, however, 3rd party back upwards tools can helpful.
compilation erlang
Comments
Post a Comment