OneIdentity
OneIdentityis an attribute assigned to a symbol, say
f, indicating thatf(x),f(f(x)),… etc. are all equivalent toxin pattern matching.
Examples
OneIdentity affects pattern matching. It does not affect evaluation.
>> SetAttributes[f, OneIdentity]
>> a /. f(x_:0, u_) -> {u}{a}However, without a default argument, the pattern does not match:
>> a /. f(u_) -> {u}aOneIdentity does not affect evaluation:
>> f(a)f(a)