A common mistake is to try to define a list without the quotation like:
(the white house)
the compiler will try to find a function called "the", because
everything after the left parentheses has to be a function if it is not
begun with quotes.
Example:
(CAR '((the white) house) ) = (the white)
(CAR '(white house) ) = white
TRY:
Example:
(CDR '((the white) house) ) = (house)
(CDR '(the white house) ) = (white house)
TRY:
(CAAR l), (CADR l) and others and
are provided to have an equivalent to (CAR (CAR l)) or
(CAR (CDR l)) and so on.
TRY: Write the equivalent function for
(CAR (CDR (CDR (quote (a b c d e)))))
Example:
(CONS 'the '(white house) ) = (the white house)
(CONS '(the) '(white house) ) = ((the) white house)
TRY:
Example:
(ATOM '(white house) ) = Nil
(ATOM 'white ) = T
TRY:
Example:
(NULL '(white house) ) = Nil
(NULL 'white ) = Nil
(NULL '() ) = T
TRY:
Example:
(QUOTE (white house) ) = (white house)
(QUOTE white ) = white
(QUOTE () ) = ()
TRY: