WolframLang: Head of Expression

By Xah Lee. Date: . Last updated: .

All WolframLang Expression, is either an Atom such as Number, Symbol, String, or in the form of a[b, c, etc] where the elements are themselves expression.

The a in b[etc] is called the Head of expression.


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. Example: 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

Expression, Atom, Head