January 2020
Intermediate to advanced
532 pages
13h 31m
English
The MacroTools package provides a macro called @capture that can be used to match an expression against a pattern. As part of the matching process, it also assigns variables for which the developer wishes to capture the matched values.
The @capture macro accepts two arguments; the first one is an expression that needs to be matched, and the second one is a pattern used for matching. Consider the following example:

The macro returns true when the pattern can be matched, or else it just returns false. When the pattern is matched, the variables ending with an underscore will be assigned in the current environment, with ...
Read now
Unlock full access