Is there support for top-notch templates in Erlang?
f(SomeMagicPattern) -> receive SomeMagicPattern -> ok end.
If there is no answer (support), do you know any other approach to achieve this? For example, using macros?
No, Erlang does not have first-class templates out of the box. This can be implemented in two ways:
Macros. Widely used, for example, in testing tools such as EUnit and PropEr. Say EUnit has a macro? AssertMatch, which is actually an example of first-class templates:
? assertMatch ({ok, _}, Result)
Converts syntax. It is harder to write, but potentially more powerful, because with their help you can access the Erlang Erlang code and completely rewrite it, in any way. There's a good link to a series of parsing tutorials transforming here: There is a nice, complete Erlang parsing tutorial transforms available
As Demeshchuk points out, this is not so.
However, there is a suggestion to add something similar to the language:
http://www.erlang.org/eeps/eep-0029.html
Is this a good idea, this is a completely different question ...
Source: https://habr.com/ru/post/1436358/More articles:UIlabel shrinks when scrolling UiTableView - iphoneDoctrine 2: Created objects from the database do not have namespaces - phpMake the width of the div div the width to the left and not the right - htmlWhat is the difference between an expression and an expression using Python? - pythonHow to hide folders in public_html folder of websites? - webserverXStream xsd check - javaUsing wildcards with rename - unixHow to install / active syslogd on iPhone / iPad - ioshttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1436362/where-can-i-find-the-p2-repository-specification&usg=ALkJrhjkRWp6fP5lHnvf33jZSZpPgBsAgwonClickListener for disabled edittext not called - androidAll Articles