diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-05 23:49:19 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-05 23:49:19 +0200 |
commit | 82fa3c361b7ca68726926d3cef744cbb41c1ea29 (patch) | |
tree | ab278deff1ab999b1b08a69214ed9838ca48b2e7 | |
parent | de143451c3a72616963340ef7cfea97fcedba3ae (diff) |
Add functions FIRST ... TENTH.
-rw-r--r-- | init.lisp | 1 | ||||
-rw-r--r-- | list-functions.lisp | 50 |
2 files changed, 51 insertions, 0 deletions
@@ -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)))))) |