The example discussed in Creating a Custom Syntax shows a macro that uses transient changes to create the intended operational impact. Alternatively, you can create a commit script that uses persistent changes to add the standard JUNOS statements to the candidate configuration and delete your custom syntax entirely. This way, a network operator who might be unfamiliar with your custom syntax can view the configuration file and see the full configuration rendered as standard JUNOS statements. Still, because the commit script macro remains in effect, you can quickly and easily create a complex configuration using your custom syntax.
In addition to the type of application discussed in Creating a Custom Syntax, you can also use macros to prevent a commit script from performing a task. For example, a basic commit script that automatically adds Multiprotocol Label Switching (MPLS) configuration to interfaces can make an exception for interfaces you explicitly tag as not requiring MPLS, by testing for the presence of an apply-macro statement named no-mpls. For a configuration example showing this use of macros, see Controlling LDP Configuration.
You can use the apply-macro statement as a place to store external data. The commit script does not inspect the apply-macro statement, so the apply-macro statement has no operational impact on the routing platform, but the data can be carried in the configuration file to be used by external applications.