WhizzML Reference Manual

2.3 Procedure calls

A procedure call is written by simply enclosing in parenthesis an expression for the procedure to be called followed by expressions for its arguments. WhizzML is an eager language: the expressions for the procedure and its arguments (in that order) are fully evaluated before the procedure call.

Oftentimes, the expression for the procedure to be called is simply a variable reference, as in the following examples:

(+ 2 3 4)
(* (/ 1 2) x)
(rand)
(create-dataset {"source" src-id})
(wait (create-source {"remote" "http://host.com/foo.csv"}) 1000)

where we call the procedures referenced by the identifiers +, /, *, rand, create-dataset, create-source and wait. More generally, any expression that evaluates to a procedure is allowed, e.g.:

((if (= x 0) * /) 42 x)

which either multiplies or divides 42 by x, depending on whether the latter is zero or not.

It is also possible to apply a procedure to a list of arguments constructed on the fly by means of the standard library procedure apply, as described in section 4.4 .