OneIdentity

OneIdentity

is an attribute that can be assigned to a symbol f to indicate that f[x], f[f[x]], etc. are all equivalent to x for the purpose of pattern matching.

Details

Examples

open allclose all

Basic Examples  (1)

The pattern matches, because Times has attribute OneIdentity:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Any function with attribute OneIdentity will match:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Properties & Relations  (2)

Possible Issues  (1)

See Also

Flat  Nest

Tutorials

Introduced in 1988
(1.0)
| Updated in 2003
(5.0)