Notes

Chapter 3: The World of Simple Programs

Section 10: Symbolic Systems


Symbolic expressions

Expressions like Log[x] and f[x] that give values of functions are familiar from mathematics and from typical computer languages. Expressions like f[g[x]] giving compositions of functions are also familiar. But in general, as in Mathematica, it is possible to have expressions in which the head h in h[x] can itself be any expression—not just a single symbol. Thus for example f[g][x], f[g[h]][x] and f[g][h][x] are all possible expressions. And these kinds of expressions often arise in Mathematica when one manipulates functions as a whole before applying them to arguments. (D[f[x], x, x] for example gives f''[x] which is Derivative[2][f][x].) (In principle one can imagine representing all objects with forms such as f[x, y] by so-called currying as f[x][y], and indeed I tried this in the early 1980s in SMP. But although this can be convenient when f is a discrete function such as a matrix, it is inconsistent with general mathematical and other usage in which for example Gamma[x] and Gamma[a, x] are both treated as values of functions.)

From Stephen Wolfram: A New Kind of Science [citation]