Changeset 8512


Ignore:
Timestamp:
02/09/05 18:35:37 (16 years ago)
Author:
piso
Message:

More TYPE FIXNUM declarations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/find.lisp

    r8509 r8512  
    22;;;
    33;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: find.lisp,v 1.8 2005-02-09 15:45:56 piso Exp $
     4;;; $Id: find.lisp,v 1.9 2005-02-09 18:35:37 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    136136
    137137(defun list-position* (item sequence from-end test test-not start end key)
    138   (when (null end) (setf end (length sequence)))
    139   (list-position item sequence))
     138  (declare (type fixnum start))
     139  (let ((end (or end (length sequence))))
     140    (declare (type fixnum end))
     141    (list-position item sequence)))
    140142
    141143(defun vector-position* (item sequence from-end test test-not start end key)
    142   (when (null end) (setf end (length sequence)))
    143   (vector-position item sequence))
     144  (declare (type fixnum start))
     145  (let ((end (or end (length sequence))))
     146    (declare (type fixnum end))
     147    (vector-position item sequence)))
    144148
    145149(defmacro vector-position-if (test sequence)
     
    150154
    151155(defun position-if (test sequence &key from-end (start 0) key end)
    152   (let ((end (or end (length sequence))))
     156  (declare (type fixnum start))
     157  (let ((end (or end (length sequence))))
     158    (declare (type fixnum end))
    153159    (if (listp sequence)
    154160        (list-position-if test sequence)
     
    162168
    163169(defun position-if-not (test sequence &key from-end (start 0) key end)
    164   (let ((end (or end (length sequence))))
     170  (declare (type fixnum start))
     171  (let ((end (or end (length sequence))))
     172    (declare (type fixnum end))
    165173    (if (listp sequence)
    166174        (list-position-if-not test sequence)
     
    180188
    181189(defun list-find* (item sequence from-end test test-not start end key)
    182   (when (null end) (setf end (length sequence)))
    183   (list-find item sequence))
     190  (let ((end (or end (length sequence))))
     191    (declare (type fixnum end))
     192    (list-find item sequence)))
    184193
    185194(defun vector-find* (item sequence from-end test test-not start end key)
    186   (when (null end) (setf end (length sequence)))
    187   (vector-find item sequence))
     195  (let ((end (or end (length sequence))))
     196    (declare (type fixnum end))
     197    (vector-find item sequence)))
    188198
    189199(defmacro vector-find-if (test sequence)
     
    195205(defun find-if (test sequence &key from-end (start 0) end key)
    196206  (let ((end (or end (length sequence))))
     207    (declare (type fixnum end))
    197208    (if (listp sequence)
    198209        (list-find-if test sequence)
     
    207218(defun find-if-not (test sequence &key from-end (start 0) end key)
    208219  (let ((end (or end (length sequence))))
     220    (declare (type fixnum end))
    209221    (if (listp sequence)
    210222        (list-find-if-not test sequence)
    211223        (vector-find-if-not test sequence))))
    212 
    213 (eval-when (:execute)
    214   (when (and (fboundp 'jvm::jvm-compile) (not (autoloadp 'jvm::jvm-compile)))
    215     (mapcar #'jvm::jvm-compile '(position
    216                                  list-position*
    217                                  vector-position*
    218                                  position-if
    219                                  position-if-not
    220                                  find
    221                                  list-find*
    222                                  vector-find*
    223                                  find-if
    224                                  find-if-not))))
Note: See TracChangeset for help on using the changeset viewer.