Buy the book!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
The following expression creates and gives initial values
to the two variables
tiger. The body of the
let expression is a list which calls the
(let ((zebra 'stripes) (tiger 'fierce)) (message "One kind of animal has %s and another is %s." zebra tiger))
Here, the varlist is
((zebra 'stripes) (tiger 'fierce)).
The two variables are
tiger. Each variable is
the first element of a two-element list and each value is the second
element of its two-element list. In the varlist, Emacs binds the
zebra to the value
stripes, and binds the
tiger to the value
fierce. In this example,
both values are symbols preceded by a quote. The values could just as
well have been another list or a string. The body of the
follows after the list holding the variables. In this example, the body
is a list that uses the
message function to print a string in
the echo area.
You may evaluate the example in the usual fashion, by placing the cursor after the last parenthesis and typing C-x C-e. When you do this, the following will appear in the echo area:
"One kind of animal has stripes and another is fierce."
As we have seen before, the
message function prints its first
argument, except for `%s'. In this example, the value of the variable
zebra is printed at the location of the first `%s' and the
value of the variable
tiger is printed at the location of the
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|