X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fcmucl-compat.lisp;h=8e7df718a3ce1b5a0c9538c56abb2976e67dcdef;hb=8d558ce162d1360f92e4d65d054e2f61c786319e;hp=3da769492d82e0cf8583f66d24b4d5c05bac03d6;hpb=0140f390dc26d640b2289c212da82e5b3f51106f;p=clsql.git diff --git a/base/cmucl-compat.lisp b/base/cmucl-compat.lisp index 3da7694..8e7df71 100644 --- a/base/cmucl-compat.lisp +++ b/base/cmucl-compat.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: cmucl-compat.lisp,v 1.2 2002/10/14 04:09:02 kevin Exp $ +;;;; $Id: cmucl-compat.lisp,v 1.4 2003/05/02 03:05:54 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,7 +16,6 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :cl-user) (defpackage :cmucl-compat @@ -29,15 +28,15 @@ )) (in-package :cmucl-compat) -#+cmu +#+(or cmu scl) (defmacro required-argument () `(ext:required-argument)) -#-cmu +#-(or cmu scl) (defun required-argument () (error "~&A required keyword argument was not supplied")) -#+cmu +#+(or cmu scl) (defmacro shrink-vector (vec len) `(lisp::shrink-vector ,vec ,len)) @@ -45,7 +44,7 @@ (defmacro shrink-vector (vec len) `(sb-kernel::shrink-vector ,vec ,len)) -#-(or cmu sbcl) +#-(or cmu sbcl scl) (defmacro shrink-vector (vec len) "Shrinks a vector. Optimized if vector has a fill pointer. Needs to be a macro to overwrite value of VEC." @@ -56,9 +55,11 @@ Needs to be a macro to overwrite value of VEC." ((typep ,vec 'simple-array) (let ((,new-vec (make-array ,len :element-type (array-element-type ,vec)))) - (dotimes (i ,len) - (declare (fixnum i)) - (setf (aref ,new-vec i) (aref ,vec i))) + (check-type ,len fixnum) + (locally (declare (speed 3) (safety 0) (space 0)) + (dotimes (i ,len) + (declare (fixnum i)) + (setf (aref ,new-vec i) (aref ,vec i)))) (setq ,vec ,new-vec))) ((typep ,vec 'vector) (setf (fill-pointer ,vec) ,len) @@ -68,40 +69,19 @@ Needs to be a macro to overwrite value of VEC." ))) - -#-(or cmu sbcl) +#-(or cmu scl) (defun make-sequence-of-type (type length) "Returns a sequence of the given TYPE and LENGTH." - (declare (fixnum length)) - (case type - (list - (make-list length)) - ((bit-vector simple-bit-vector) - (make-array length :element-type '(mod 2))) - ((string simple-string base-string simple-base-string) - (make-string length)) - (simple-vector - (make-array length)) - ((array simple-array vector) - (if (listp type) - (make-array length :element-type (cadr type)) - (make-array length))) - (t - (make-sequence-of-type (result-type-or-lose type t) length)))) - + (make-sequence type length)) -#+cmu +#+(or cmu scl) (if (fboundp 'lisp::make-sequence-of-type) (defun make-sequence-of-type (type len) (lisp::make-sequence-of-type type len)) (defun make-sequence-of-type (type len) (system::make-sequence-of-type type len))) -#+sbcl -(defun make-sequence-of-type (type len) - (sb-impl::make-sequence-of-type type len)) - -#-(or cmu sbcl) +#-(or cmu scl) (defun result-type-or-lose (type nil-ok) (unless (or type nil-ok) (error "NIL output type invalid for this sequence function")) @@ -118,10 +98,6 @@ Needs to be a macro to overwrite value of VEC." (error "~S is a bad type specifier for sequence functions." type)) )) -#+cmu +#+(or cmu scl) (defun result-type-or-lose (type nil-ok) (lisp::result-type-or-lose type nil-ok)) - -#+sbcl -(defun result-type-or-lose (type nil-ok) - (sb-impl::result-type-or-lose type nil-ok))