help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: basic help evaluating function in an alist


From: Drew Adams
Subject: RE: basic help evaluating function in an alist
Date: Sat, 1 Dec 2012 19:44:53 -0800

> > '(guide . (selected-window))
> >
> > (cons 'guide (selected-window))
>
> I still don't quite understand what it is in the
> syntax that causes the function (selected-window) to be evaluated in
> one case and not the other

In the first case, the dotted pair `(guide . (selected-window))' is quoted.
When evaluated, the sexp `(quote (guide . (selected-window)))' returns that
dotted pair: `(guide . (selected-window))'.  `quote' returns its argument
without evaluating it.

In the second case, the sexp `(cons 'guide (selected-window))' is evaluated,
which means applying function `cons' to its two arguments, after evaluating each
of them.

Evaluation of the first argument, which is `(quote guide)', returns the symbol
`guide'.  Evaluation of the second arg, `(selected-window)', returns the
selected window.  Function `cons' then creates a cons cell whose car is the
symbol `guide' and whose cdr is that window.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]