summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lisp1
-rw-r--r--list-functions.lisp50
2 files changed, 51 insertions, 0 deletions
diff --git a/init.lisp b/init.lisp
index 8c93cc9..a74f771 100644
--- a/init.lisp
+++ b/init.lisp
@@ -1,2 +1,3 @@
(load "util.lisp")
(load "cond.lisp")
+(load "list-functions.lisp")
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))))))