Go to the first, previous, next, last section, table of contents.


Function Call Forms

The first element of a function call form is the name of the function, this can be either a symbol (in which case the symbol's function value is indirected through to get the real function definition) or a lambda expression (see section Lambda Expressions).

Any other elements of the list are forms to be evaluated (in left to right order) and their values become the arguments to the function. The function is applied to these arguments and the result that it returns becomes the value of the form.

For example, consider the form (/ 100 (1+ 4)). This is a function call to the function /. First the 100 form is evaluated: it returns the value 100, next the form (1+ 4) is evaluated. This is also a function call and computes to a value of 5 which becomes the second argument to the / function. Now the / function is applied to its arguments of 100 and 5 and it returns the value 20 which then becomes the value of the form (/ 100 (1+ 4)).

(/ 100 (1+ 4))
== (/ 100 5)
=> 20

Or another example,

(+ (- 10 (1- 7)) (* (1+ 2) 4)
== (+ (- 10 6) (* (1+ 2) 4)
== (+ 4 (* (1+ 2) 4)
== (+ 4 (* 3 4))
== (+ 4 12)
=> 16


Go to the first, previous, next, last section, table of contents.