(plot-function (function sin) (- pi) pi)
The expression "2D (function sin) is needed to extract the function associated with the symbol "2D sin. Just using "2D sin will not work. The reason is that a symbol in Lisp can have both a value, perhaps set using "2D def, and a function definition at the same time. 5 This may seem a bit cumbersome at first, but it has one great advantage: Typing an innocent expression like
(def list '(2 3 4))will not destroy the "2D list function.
Extracting a function definition from a symbol is done almost as often as quoting an expression, so again a simple shorthand notation is available. The expression
#'sinis equivalent to the expression "2D (function sin). The short form "2D #' is usually pronounced sharp-quote. Using this abbreviation the expression for producing the sine plot can be written as
(plot-function #'sin (- pi) pi)