Re: Newb question: when is it a function when is it a list?



Anonymous <nobody@xxxxxxxxxxxxxxxxxxxxxx> writes:

Hi guys I don't understand how Lisp (CLISP) decides whether something is a
function call or a list.

I am using emacs/slime and I entered this:

(defvar alist '(this is a list))

If I type alist it echoes (this is a list) but if I type (alist) I get an
undefined function error. Why is a list inside parens not equivalent to
(list nil)?

I also get an error when I type (alist nil). If the problem with (alist) is
the nil isn't implied then why doesn't (alist nil) work?

See http://l1sp.org/cl/3.1.2.1 for the description of how CL evaluates
forms.

Zach

.



Relevant Pages