summaryrefslogtreecommitdiff
path: root/list-functions.lisp
blob: 1aac8f88696733b3e313ba65fcd7b6eb9708fe5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
(%defmacro pushq args
  (list* 'setq (car (cdr args)) (car args)))

(%defun first args
  (car (car args)))


;;;;-----------------------------------------------------------------
;;;; THE CxR FUNCTIONS
;;;;-----------------------------------------------------------------
(%defun caaaar args
  (car (caaar (first args))))

(%defun caaadr args
  (car (caadr (first args))))

(%defun caaar args
  (car (caar (first args))))

(%defun caadar args
  (car (cadar (first args))))

(%defun caaddr args
  (car (caddr (first args))))

(%defun caadr args
  (car (cadr (first args))))

(%defun caar args
  (car (car (first args))))

(%defun cadaar args
  (car (cdaar (first args))))

(%defun cadadr args
  (car (cdadr (first args))))

(%defun cadar args
  (car (cdar (first args))))

(%defun caddar args
  (car (cddar (first args))))

(%defun cadddr args
  (car (cdddr (first args))))

(%defun caddr args
  (car (cddr (first args))))

(%defun cadr args
  (car (cdr (first args))))

(shadow 'car)
(export 'car)
(%defun car args
  (sys::car (first args)))

(%defun cdaaar args
  (cdr (caaar (first args))))

(%defun cdaadr args
  (cdr (caadr (first args))))

(%defun cdaar args
  (cdr (caar (first args))))

(%defun cdadar args
  (cdr (cadar (first args))))

(%defun cdaddr args
  (cdr (caddr (first args))))

(%defun cdadr args
  (cdr (cadr (first args))))

(%defun cdar args
  (cdr (car (first args))))

(%defun cddaar args
  (cdr (cdaar (first args))))

(%defun cddadr args
  (cdr (cdadr (first args))))

(%defun cddar args
  (cdr (cdar (first args))))

(%defun cdddar args
  (cdr (cddar (first args))))

(%defun cddddr args
  (cdr (cdddr (first args))))

(%defun cdddr args
  (cdr (cddr (first args))))

(%defun cddr args
  (cdr (cdr (first args))))

(shadow 'cdr)
(export 'cdr)
(%defun cdr args
  (sys::cdr (first args)))


;;;;-----------------------------------------------------------------
;;;; SECOND ... TENTH
;;;;-----------------------------------------------------------------
(%defun second args
  (cadr (car args)))

(%defun third args
  (caddr (car args)))

(%defun fourth args
  (car (cdddr (car args))))

(%defun fifth args
  (cadr (cdddr (car args))))

(%defun sixth args
  (caddr (cdddr (car args))))

(%defun seventh args
  (car (cdddr (cdddr (car args)))))

(%defun eigthth args
  (cadr (cdddr (cdddr (car args)))))

(%defun ninth args
  (caddr (cdddr (cdddr (car args)))))

(%defun tenth args
  (car (cdddr (cdddr (cdddr (car args))))))


;;;;-----------------------------------------------------------------
;;;; CONS
;;;;-----------------------------------------------------------------
(shadow 'cons)
(export 'cons)
(%defun cons args
  (sys::cons (first args) (second args)))