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

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

Re: (list) and '(list)


From: Tim X
Subject: Re: (list) and '(list)
Date: Fri, 27 Apr 2007 10:58:34 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

A Soare <alinsoar@voila.fr> writes:

> Can somebody tell me if there already is a code that makes the distintion 
> between a list that evaluates as a function like
>
> (function ...
>
> and between a list that evaluates to itself :
>
> '(list ... , and its aliases like (quote (list ... etc
>

First, you have it around the wrong way. ' is the shorthand (alias if you like)
for (quote .....). If you ignore ', then a clear pattern emerges. Essentially,
all lists are evaluated when viewed from the top level. The (quote ....) is
different in that it short circuits evaluation - it returns its arguements
without evaluating them. In all other situations, the arguements are evaluated.

Putting it another way, given any list

(x y z)

x is always evaluated, but if x is the function quote, evaluation halts there.
otherwise, y and z are evaluated to determine the arguements to x. 

I suspect you may be asking thw rong question. Maybe explain more about what
you want to do and others on the list will be able to give you better
advice/direction.

Tim
-- 
tcross (at) rapttech dot com dot au


reply via email to

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