WolframLang: Head of Expression
All WolframLang
Expression,
is either an
Atom such as number, symbol, string,
or in the form of
e0[e1, e2 etc]
where the elements are themselves expression.
The e0 in e0[…]
is called the Head of expression.
Head[expr]
- return the head of expression.
Head of Non-Atomic Expression
Head[ f[x] ] === f Head[ {3,4} ] === List Head[ x+y ] === Plus
The head itself can be arbitrary expression. e.g.
in
a[b, c][d, e]
,
the a[b, c]
is the head,
and a
is the head of the sub-expression
a[b, c]
.
Head[ a[b, c][d, e] ] === a[b, c]
Head of Atoms
Atomic Expression, such as number, string, symbol, are also given a head.
Head of Numbers
Head[3] === Integer Head[3.0] === Real Head[3/4] === Rational Head[3+ 4 I] === Complex
Head of symbol, string, special character
Head[ x ] === Symbol Head[ Pi ] === Symbol Head[ "abc" ] === String Head[ \[Pi] ] === Symbol