Hot answers tagged


The two examples in this question relate to two different aspects of pattern matching. I will start with the simpler to understand and intentional aspect, which is the second example. g[2] /. g[ 1 + (1|other) ] -> post (* g[2] *) In the above, the pattern doesn't match, and it can never match. g[2] has one argument. Since Plus is OneIdentity, 2 ...

Only top voted, non community-wiki answers of a minimum length are eligible