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: Matt Price
Subject: Re: basic help evaluating function in an alist
Date: Tue, 4 Dec 2012 09:41:46 -0500

On Sat, Dec 1, 2012 at 10:44 PM, Drew Adams <drew.adams@oracle.com> wrote:
>> > '(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.
>
Drew, I forgot to write and say thank you.  this was a big help.
matt



reply via email to

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