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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -