About Expressions

A simple expression is a function call. This can be two data items joined by an operator; it can be a call to a primitive; or it can be a call to a user-defined function. For example, each of the following is a simple expression:

2*3
x+y
5!
sqrt(4)
MyFunction(3,4)

A compound expression is similar to a simple expression except one or more of the data items is another expression. For example, 2*3 and 4*5 are both simple expressions, so 2*3+4*5 is a compound expression. There is no practical limit to how long a compound expression can be. Following are some examples:

2*3/(x+y)
sqrt(5!)
MyFunction(sqrt(5!),4)
makelist(makelist(f(x)+g(y),x,1,10),y,1,10)

Anywhere you can enter a simple expression, you can also enter a compound expression. Since there is no need to draw a distinction between these types, this guide refers to both simple and compound expressions as expressions.