You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attributes like Flat can affect not only evaluation, but also operations such as pattern matching. If you give definitions or transformation rules for a function, you must be sure to have specified the attributes of the function first.
Here is a definition for the flat function f:
In[3]:= f[x_, x_] := f[x] https://wolfram.com/xid/0m5dyglvgmwz4-si8
Because f is flat, the definition is automatically applied to every subsequence of arguments:
In[4]:= f[a, a, a, b, b, b, c, c] https://wolfram.com/xid/0m5dyglvgmwz4-iw6
Out[4]= f[a, b, c]