TagSet
[f, expr, value]/:
expr =
value Create an upvalue without using UpSet
:
square /: area[square[s_]] := s^2
DownValues[square]
UpValues[square]
The symbol f must appear as the ultimate head of lhs or as the head of an element in lhs:
x /: f[g[x]] = 3;
g /: f[g[x]] = 3;
f[g[x]]