(CONS X Y)
makes a pair like this:
(X . Y)
In other words, X is the CAR of the pair; Y is the CDR of the pair. For
example:
(CONS 1 2) ==> (1 . 2)
(CONS 1 '(2 3)) ==> (1 2 3)
[The pair (1 . (2 3)) is the same thing as (1 2 3)].
> APPEND
(APPEND X Y)
makes a new list by replacing the final nil in X with the list Y. X and
Y must be proper lists. For example:
(APPEND '(1) '(2 3)) ==> (1 2 3)
(In fact, append takes any number of arguments and appends them in this
fashion).
(APPEND '(1 . 2) '(3 . 4))
doesn't work because the arguments are not proper lists (that is, they
are pairs, but their CDRs are not lists). APPEND only works on proper
lists (pairs whose CDRs are lists or NIL).
> LIST
Takes any number of arguments. Returns a list whose elements are the
values of those arguments in the same order they appear in the LIST
form. For example,
(LIST 1) ==> (1)
(LIST 1 2) ==> (1 2)
(LIST 1 2 '(3 4)) ==> (1 2 (3 4))
(LIST (+ 2 3)(* 2 3)) ==> (5 6)
>> APPEND
>
>
> (APPEND X Y)
>
> makes a new list by replacing the final nil in X with the list Y. X and
> Y must be proper lists. For example:
>
> (APPEND '(1) '(2 3)) ==> (1 2 3)
>
> (In fact, append takes any number of arguments and appends them in this
> fashion).
>
> (APPEND '(1 . 2) '(3 . 4))
>
> doesn't work because the arguments are not proper lists (that is, they
> are pairs, but their CDRs are not lists). APPEND only works on proper
> lists (pairs whose CDRs are lists or NIL).
Oops; the last argument is allowed to be something other than a proper list.