From: todd english
Subject: new to lisp and a litle confused about...
Date: 
Message-ID: <2AVYb.64431$vn.181757@sea-read.news.verio.net>
Essential Info:
GNU CLISP interpreter version 2.31
Windows 2000 environment

The following two examples work as I would expect:
15. Break [22]> (first '(first (rest (rest ( (a b) (c d) (e f) ) ) ) ) )
FIRST

15. Break [22]> (first (first (rest '(rest ( (a b) (c d) (e f) ) ) ) ) )
(A B)

But the following example produces the following error:
15. Break [22]> (first (first '(rest (rest ( (a b) (c d) (e f) ) ) ) ) )

** - Continuable Error
FIRST: REST is not a LIST
If you continue (by typing 'continue'): Retry
The following restarts are also available:
STORE-VALUE    :R1      You may input a new value for (FDEFINITION 'A).
USE-VALUE      :R2      You may input a value to be used instead of
(FDEFINITION 'A).
STORE-VALUE    :R3      You may input a new value for REST.
USE-VALUE      :R4      You may input a value to be used instead of REST.
USE-VALUE      :R5      You may input a value to be used instead.
USE-VALUE      :R6      You may input a value to be used instead.
STORE-VALUE    :R7      You may input a new value for FIRST.
USE-VALUE      :R8      You may input a value to be used instead of FIRST.
STORE-VALUE    :R9      You may input a new value for FIRST.
USE-VALUE      :R10     You may input a value to be used instead of FIRST.
CONTINUE       :R11     Retry
STORE-VALUE    :R12     You may input a new value for (FDEFINITION
'FRIENDS).
USE-VALUE      :R13     You may input a value to be used instead of
(FDEFINITION 'FRIENDS).

Is this a interpreter bug, or am I not fully understanding LISP nesting?

Thank you for any insight you may share,
Todd English
From: Adam Warner
Subject: Re: new to lisp and a litle confused about...
Date: 
Message-ID: <pan.2004.02.19.03.11.14.894718@consulting.net.nz>
Hi todd english,

> (first (first '(rest (rest ((a b) (c d) (e f))))))

You are quoting this object:
(rest (rest ((a b) (c d) (e f))))

Let's call the object OBJ.

Thus you are evaluating:

(first (first OBJ))

Now    (first OBJ) => rest

Do you now see the problem? You can't find the first element of a symbol!

Regards,
Adam