From 142c8756f0052115a4c32cb3b66fe613292c4a83 Mon Sep 17 00:00:00 2001 From: Strigoides Date: Sat, 27 Apr 2013 06:52:51 +1200 Subject: [PATCH] Add the rest of the C[AD]*R functions --- jscl.lisp | 1 + src/list.lisp | 40 ++++++++++++++++++++++++++++++++++++++++ src/toplevel.lisp | 6 ++++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 src/list.lisp diff --git a/jscl.lisp b/jscl.lisp index 3a70e2e..2beefa1 100644 --- 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 index 0000000..b59cfb2 --- /dev/null +++ b/src/list.lisp @@ -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 . + +;;;; 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))) diff --git a/src/toplevel.lisp b/src/toplevel.lisp index 0a1b4dd..64a0e87 100644 --- a/src/toplevel.lisp +++ b/src/toplevel.lisp @@ -49,8 +49,10 @@ (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 -- 1.7.10.4