1 ; (in-package "COMMON-LISP")
3 ; ;; Define some list accessing functions.
4 ; (defun caar (x) (car (car x)))
5 ; (defun cadr (x) (car (cdr x)))
6 ; (defun cdar (x) (cdr (car x)))
7 ; (defun cddr (x) (cdr (cdr x)))
9 ; (defun caaar (x) (car (car (car x))))
10 ; (defun caadr (x) (car (car (cdr x))))
11 ; (defun cadar (x) (car (cdr (car x))))
12 ; (defun caddr (x) (car (cdr (cdr x))))
13 ; (defun cdaar (x) (cdr (car (car x))))
14 ; (defun cdadr (x) (cdr (car (cdr x))))
15 ; (defun cddar (x) (cdr (cdr (car x))))
16 ; (defun cdddr (x) (cdr (cdr (cdr x))))
18 ; (defun caaaar (x) (car (car (car (car x)))))
19 ; (defun caaadr (x) (car (car (car (cdr x)))))
20 ; (defun caadar (x) (car (car (cdr (car x)))))
21 ; (defun caaddr (x) (car (car (cdr (cdr x)))))
22 ; (defun cadaar (x) (car (cdr (car (car x)))))
23 ; (defun cadadr (x) (car (cdr (car (cdr x)))))
24 ; (defun caddar (x) (car (cdr (cdr (car x)))))
25 ; (defun cadddr (x) (car (cdr (cdr (cdr x)))))
26 ; (defun cdaaar (x) (cdr (car (car (car x)))))
27 ; (defun cdaadr (x) (cdr (car (car (cdr x)))))
28 ; (defun cdadar (x) (cdr (car (cdr (car x)))))
29 ; (defun cdaddr (x) (cdr (car (cdr (cdr x)))))
30 ; (defun cddaar (x) (cdr (cdr (car (car x)))))
31 ; (defun cddadr (x) (cdr (cdr (car (cdr x)))))
32 ; (defun cdddar (x) (cdr (cdr (cdr (car x)))))
33 ; (defun cddddr (x) (cdr (cdr (cdr (cdr x)))))
35 ; (defun endp (x) (eq x nil))
37 ; (defun first (x) (car x))
38 ; (defun second (x) (cadr x))
39 ; (defun third (x) (caddr x))
40 ; (defun fourth (x) (cadddr x))
41 ; (defun fifth (x) (car (cddddr x)))
42 ; (defun sixth (x) (cadr (cddddr x)))
43 ; (defun seventh (x) (caddr (cddddr x)))
44 ; (defun eighth (x) (cadddr (cddddr x)))
45 ; (defun ninth (x) (car (cddddr (cddddr x))))
46 ; (defun tenth (x) (cadr (cddddr (cddddr x))))
48 ; ;; Appends list A to list B
49 ; (sys:set-symbol-function 'append
53 ; (cons (car a) (append (cdr a) b)))))
55 ; ;; Copies and returns the passed tree.
56 ; (defun copy-tree (tree)
58 ; (cons (copy-tree (car tree))
59 ; (copy-tree (cdr tree)))
62 ; ;; Identity returns whatever was passed to the function
63 ; (defun identity (object) object)
65 ; ;; For working with association lists.
66 ; (defun acons (key val list)
67 ; (cons (cons key val) list))