Editing macro properties
Every macro has the following editable properties:
-
Macro name
-
Macro arguments
-
Macro expansion
-
Description
The name of a macro is its unique identifier as compared to other macros. You cannot have two macros with the same name in the same list. You can, however, have two macros with the same name in different lists (in which case, review the paragraph above describing precedence of macro evaluation). In addition, macro names should generally consist of only alphanumeric upper and lower case characters, such as MY_FIRST_MACRO_1, or MyFavoriteMacro, so that you are less likely to encounter syntax errors later when embedding the macro within one of your expressions.
Hyphens (dashes, the "-" character) are not allowed within macro names.
Macro arguments are special named arguments and values that can be passed to a macro expression.
A macro’s expansion is also known as the macro’s rule, or expression, or sometimes is referred to as the macro itself. It is the core property of the macro that contains the expression used by the macro. Essentially, whenever you use the macro’s name within one of your SRL/PDL expressions, the macros name will be removed and then replaced with the text of your macro’s expression (or expansion). As macro names are usually short, and macro expressions are usually long, it helps to remember this property as it "expands" the macro when the macro is used. Depending on whether you are creating a PDL or an SRL expression, writing a macro is precisely like editing a search query or taxonomy query that uses PDL, or using a Derive or Filter Rows node that uses SRL. The syntax is the same. The benefit of a macro then is that if you find yourself routinely using the same type of expression in several of your projects or nodes, you can essentially capture the expression, give it a name, and then reference the expression by name in your future configuration steps to save yourself time (and possibly avoid mistakes).
A macro’s description is an open-ended text area where you can place any text you prefer. There are several uses of the description field.
Alternatively, use the description area like a scratch pad, and copy and paste text into it.
Alternatively, use the description area like a to-do list and write down nodes about how you wish to improve the macro. Every macro has its own description. The description has no effect on the logic of the macro, only its expression affects the logic. There is no concern regarding scalability.