Add the rest of the C[AD]*R functions
authorStrigoides <Strigoides@gmail.com>
Fri, 26 Apr 2013 18:52:51 +0000 (06:52 +1200)
committerStrigoides <Strigoides@gmail.com>
Fri, 26 Apr 2013 18:52:51 +0000 (06:52 +1200)
jscl.lisp
src/list.lisp [new file with mode: 0644]
src/toplevel.lisp

index 3a70e2e..2beefa1 100644 (file)
--- a/jscl.lisp
+++ b/jscl.lisp
@@ -23,6 +23,7 @@
     ("print"     :target)
     ("read"      :both)
     ("compiler"  :both)
+    ("list"      :target)
     ("toplevel"  :target)))
 
 (defun source-pathname
diff --git a/src/list.lisp b/src/list.lisp
new file mode 100644 (file)
index 0000000..b59cfb2
--- /dev/null
@@ -0,0 +1,40 @@
+;;; list.lisp --- 
+
+;; This program is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation, either version 3 of the
+;; License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;;; Various list functions
+
+
+;;; The rest of the C[AD]*R functions; only a few were defined in boot.lisp
+(defun cadar  (x) (car (cdar  x)))
+(defun caaar  (x) (car (caar  x)))
+(defun caadr  (x) (car (cadr  x)))
+(defun cdaar  (x) (cdr (caar  x)))
+(defun cdadr  (x) (cdr (cadr  x)))
+(defun cddar  (x) (cdr (cdar  x)))
+(defun caaaar (x) (car (caaar x)))
+(defun caaadr (x) (car (caadr x)))
+(defun caadar (x) (car (cadar x)))
+(defun caaddr (x) (car (caddr x)))
+(defun cadaar (x) (car (cdaar x)))
+(defun cadadr (x) (car (cdadr x)))
+(defun caddar (x) (car (cddar x)))
+(defun cdaaar (x) (cdr (caaar x)))
+(defun cdaadr (x) (cdr (caadr x)))
+(defun cdadar (x) (cdr (cadar x)))
+(defun cdaddr (x) (cdr (caddr x)))
+(defun cddaar (x) (cdr (cdaar x)))
+(defun cddadr (x) (cdr (cdadr x)))
+(defun cdddar (x) (cdr (cddar x)))
+(defun cddddr (x) (cdr (cdddr x)))
index 0a1b4dd..64a0e87 100644 (file)
   (values-list /))
 
 (export '(&body &key &optional &rest * ** *** *gensym-counter* *package* + ++
-          +++ - / // /// 1+ 1- < <= = = > >= and append apply aref
-          arrayp assoc atom block boundp butlast caar cadddr caddr
+          +++ - / // /// 1+ 1- < <= = = > >= and append apply aref arrayp
+          assoc atom block boundp butlast cadar caaar caadr cdaar cdadr
+          cddar caaaar caaadr caadar caaddr cadaar cadadr caddar cdaaar
+          cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr caar cadddr caddr
           cadr car car case catch cdar cdddr cddr cdr cdr char
           char-code char= code-char cond cons consp constantly
           copy-list decf declaim defconstant define-setf-expander