summaryrefslogtreecommitdiff
path: root/list-functions.lisp
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-07-05 23:49:19 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-07-05 23:49:19 +0200
commit82fa3c361b7ca68726926d3cef744cbb41c1ea29 (patch)
treeab278deff1ab999b1b08a69214ed9838ca48b2e7 /list-functions.lisp
parentde143451c3a72616963340ef7cfea97fcedba3ae (diff)
Add functions FIRST ... TENTH.
Diffstat (limited to 'list-functions.lisp')
-rw-r--r--list-functions.lisp50
1 files changed, 50 insertions, 0 deletions
diff --git a/list-functions.lisp b/list-functions.lisp
new file mode 100644
index 0000000..f379e19
--- /dev/null
+++ b/list-functions.lisp
@@ -0,0 +1,50 @@
+(%defmacro pushq args
+ (list* 'setq (car (cdr args)) (car args)))
+
+(%defun first args
+ (car (car args)))
+
+(%defun caar args
+ (car (cdr (first args))))
+
+(%defun cadr args
+ (car (cdr (first args))))
+
+(%defun cdar args
+ (car (cdr (first args))))
+
+(%defun cddr args
+ (cdr (cdr (first args))))
+
+(%defun caddr args
+ (car (cddr (first args))))
+
+(%defun cdddr args
+ (cdr (cddr (first args))))
+
+(%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))))))