1. The difference is that to evaluate a function application, the
Lisp interpreter evaluates all the arguments, binds the resuting values
to the parameter names on the association list (a-list), and then evaluates
the body of the function. Whatever value it gets as the value of the body
of the function is returned as the result of the function appication.

There are three forms in Lisp (at least as we have seen it), these
being QUOTE, COND, DEFINE. The interpreter handles each one in a
separate, unique manner. So, for example, for QUOTE, it simply returns
the s-expression that appears as the argument to QUOTE without any
evaluation. So there is no way for a Lisp user to define a new form
since that would require adding, to the interpreter, the needed
special way to handle this new form. [There is something called MOP
(Meta Object Protocols) that is an extension of Lisp that does allow the
Lisp user to modify the interpreter; so the MOP user can add special
forms. By the way, the idea of "reflection" in Java is based on ideas 
from MOP and related systems.]


2. Because a Lisp expression, i.e., a Lisp program, is itself an
s-expression. So it can be taken apart easily by using the standard
primitive functions of Lisp. The Lisp interpreter doesn't need any 
elaborate "parse tree" for this purpose. 


3. Yes, sure. Here is a such function:

        (define (silly X) (quote (2 . 3)) )

If you now say (silly '(2 3)) you will get the result, (2 . 3)

For part 2, again sure. Here is one:

        (define (silly2 X) (quote (2 3)) )

If you now say (silly2 '(2 . 3)) you will get the result, (2 3)


4. Let me answer this after answering question (5).


5. There is nothing wrong with the definition. It basically will just 
return its argument (assuming that the argument is not atomic; if it is
atomic, you will get an error). So, given something like, 

         (strange '(1 2))

the interpreter will evaluate the argument which will evaluate to 
(1 2), bind it to the parameter name x, and then evaluate the body of
the function. (car x) will evaluate to 1, (cdr x) will evaluate to 
(2) and cons of these two will evaluate to (1 2); so that is what the
interpreter will output.

Given something like 

         (strange '(1 . 2))

the interpreter will evaluate the argument which will evaluate to 
(1 . 2), bind it to the parameter name x, and then evaluate the body of
the function. (car x) will evaluate to 1, (cdr x) will evaluate to 
2 and cons of these two will evaluate to (1 . 2); so that is what the
interpreter will output. The function works the same for both lists
and s-expressions that cannot be expressed as lists.


4. [First, the reason for this question is the following: Sometimes,
people will write the definition of a function such as strange as follows:

   (define (strange x) (cons (car 'x) (cdr 'x)))

That is, they will quote the x that appears in the body of the function.
The reasoning is that if they don't quote it, the interpreter will find
[in the case of, say, evaluating (strange '(1 2))] that the value bound
to x is (1 2), and then will *evaluate* that value before applying car;
and when it does that, it will get an error [that "1" is not a function
that can be applied]. That is not true; when the interpreter comes 
across the name of a parameter, it looks up the value bound to it on the 
a-list; *that* is the value; it doesn't evaluate it further. So you should
NOT quote the x in the definition of strange. If you did, it will evaluate
to the atom x [and then you will get an error when you try to find the
car or cdr of that value].

In general, the only time you quote is at the "top" level when you already
have the values to which you want to apply a given function. Elsewhere,
in bodies of functions etc., you are dealing with parameters that have to
be evaluated. So both of those pieces of advice are bad.


6. The a-list is organized as a list of pairs of the form:

     ((x . 5) (y . 6) (z . (1 2)) ...)

[In that a-list, x is bound to 5; y to 6; z to (1 2); ...]

So here is getVal:

(Note: some browsers have problems if I use the "greater than" sign
since that is used in html in a special manner. So I am using "**"
to denote that sign below and in question (7). Actually, what I need
here is an arrow sign; but the obvious way to make that up involves
using the greater than sign; I am replacing that with the **; sorry!)
   getVal[x,aL] ::
       [ null?[al] --** error! ; --** denotes an arrow
       | eq?[x, caar[aL]] --** cdar[aL];
       | #t --** getVal[x, cdr[aL]]; ]


7. The best way, no the only way, to write such functions is to make sure
that you don't try to do more than one thing in a given function. 

  biggerList[L1, L2] ::
      [ **[maxList[L1], maxList[L2]] --** L1; ** denotes "greater than"
      | #t --** L2; ]

So I am assuming that I will be able to define a function called 
maxList that will return the maximum element in its argument [which must
be a list of numbers]. Note that I did *not* try to look at the first
element of L1, try to compare it with an element of L2, etc. Because
biggerList[] shouldn't be concerned with such low level details. Instead,
we just write the Lisp code corresponding to what the problem says: 
compare the maximum of the two lists and return the appropriate result.

Next we, of course, have to write the maxList function but we have seen
how to do that (and also talked about efficiency-related issues).