Fix various function proclamations and declarations

parent 24a6ae8c
......@@ -596,7 +596,8 @@
(defmethod stream-write-string ((stream fundamental-character-output-stream)
string &optional (start 0) end)
(declare (string string)
(declare (type t stream) ; check for c::stream-designator ignored
(string string)
(fixnum start)
(ext:check-arguments-type))
(let ((end (or end (length string))))
......
......@@ -67,6 +67,8 @@
(deftype array-rank-index ()
'(integer 0 #.(1- array-rank-limit)))
(deftype bit-array ()
'(array bit *))
(deftype association-list ()
'list
#+(or)
......@@ -746,7 +748,7 @@
(proclamation vector-push-extend (t vector &optional ext:array-index)
ext:array-index)
(proclamation vectorp (t) gen-bool :pure)
(proclamation bit ((array bit) &rest ext:array-index) bit :reader)
(proclamation bit (bit-array &rest ext:array-index) bit :reader)
(proclamation sbit ((simple-array bit) &rest ext:array-index)
bit :reader)
(proclamation bit-and (bit-array bit-array &optional
......
......@@ -158,7 +158,7 @@ row-major order."
(defun bit (bit-array &rest indices)
"Args: (bit-array &rest indexes)
Returns the bit of BIT-ARRAY specified by INDEXes."
(declare (array bit-array)
(declare (array bit-array) ;; FIXME! Should be (simple-array bit)
(ext:check-arguments-type))
(row-major-aref bit-array (row-major-index-inner bit-array indices)))
......@@ -166,7 +166,7 @@ Returns the bit of BIT-ARRAY specified by INDEXes."
(defun sbit (bit-array &rest indices)
"Args: (simple-bit-array &rest subscripts)
Returns the specified bit in SIMPLE-BIT-ARRAY."
(declare (array bit-array)
(declare (array bit-array) ;; FIXME! Should be (simple-array bit)
(ext:check-arguments-type))
(row-major-aref bit-array (row-major-index-inner bit-array indices)))
......@@ -275,7 +275,7 @@ pointer as the value."
fp)
(t nil))))
(defun vector-push-extend (new-element vector &optional extension)
(defun vector-push-extend (new-element vector &optional (extension 1))
"Args: (item vector &optional (n (length vector)))
Replaces ITEM for the element of VECTOR that is pointed to by the fill-pointer
of VECTOR and then increments the fill-pointer by one. If the new value of
......@@ -288,7 +288,7 @@ Returns the new value of the fill-pointer."
(let ((d (array-total-size vector)))
(unless (< fp d)
(adjust-array vector
(list (+ d (or extension (max d 4))))
(list (+ d (max extension (max d 4))))
:element-type (array-element-type vector)
:fill-pointer fp))
(sys:aset vector fp new-element)
......@@ -324,7 +324,7 @@ pointer is 0 already."
(l (min d1 d2))
(i1 start1)
(i2 start2))
(declare (ext:array-index d1 d2 l step1 step2 i1 i2))
(declare (ext:array-index d1 d2 l i1 i2))
(if (null dims1)
#+ecl-min
(dotimes (i l)
......@@ -368,7 +368,6 @@ Adjusts the dimensions of ARRAY to the given DIMENSIONS. ARRAY must be an
adjustable array."
(declare (ignore initial-element
initial-contents
fill-pointer
displaced-index-offset))
(when (integerp new-dimensions)
(setq new-dimensions (list new-dimensions)))
......
......@@ -999,6 +999,8 @@
around the output. ATSIGN? is ignored (but allowed so that PPRINT-FILL
can be used with the ~/.../ format directive."
(declare (ignore atsign?)
(type (or stream (member t nil)) stream)
(ext:check-arguments-type)
#.+ecl-safe-declarations+)
(pprint-logical-block (stream list
:prefix (if colon? "(" "")
......@@ -1016,6 +1018,8 @@
around the output. ATSIGN? is ignored (but allowed so that PPRINT-LINEAR
can be used with the ~/.../ format directive."
(declare (ignore atsign?)
(type (or stream (member t nil)) stream)
(ext:check-arguments-type)
#.+ecl-safe-declarations+)
(pprint-logical-block (stream list
:prefix (if colon? "(" "")
......@@ -1027,7 +1031,7 @@
(write-char #\space stream)
(pprint-newline :linear stream))))
(defun pprint-tabular (stream list &optional (colon? t) atsign? tabsize)
(defun pprint-tabular (stream list &optional (colon? t) atsign? (tabsize 16))
"Output LIST to STREAM tabbing to the next column that is an even multiple
of TABSIZE (which defaults to 16) between each element. :FILL style
conditional newlines are also output between each element. If COLON? is
......@@ -1035,6 +1039,8 @@
ATSIGN? is ignored (but allowed so that PPRINT-TABULAR can be used with
the ~/.../ format directive."
(declare (ignore atsign?)
(type (or stream (member t nil)) stream)
(ext:check-arguments-type)
#.+ecl-safe-declarations+)
(pprint-logical-block (stream list
:prefix (if colon? "(" "")
......@@ -1136,6 +1142,7 @@
(defun pprint-dispatch (object &optional (table *print-pprint-dispatch*))
(declare (type (or pprint-dispatch-table null) table)
(ext:check-arguments-type)
#.+ecl-safe-declarations+)
(let* ((table (or table *initial-pprint-dispatch*))
(cons-entry
......@@ -1155,7 +1162,8 @@
(defun set-pprint-dispatch (type function &optional
(priority 0) (table *print-pprint-dispatch*))
(declare (type (or null function symbol) function)
(declare (type t type)
(type (or null function symbol) function)
(type real priority)
(type pprint-dispatch-table table)
#.+ecl-safe-declarations+)
......
......@@ -287,7 +287,8 @@
(defun delete (which sequence &key test test-not (start 0) end
from-end count key)
(declare (optimize (speed 3) (safety 1) (debug 0)))
(declare (optimize (speed 3) (safety 1) (debug 0))
(ext:no-check-arguments-type))
(cond ((listp sequence)
(if from-end
(let ((l (length sequence)))
......@@ -503,7 +504,6 @@
&key key (test '#'eql) test-not
(start 0) (end (length sequence)) (from-end nil))
Returns a copy of SEQUENCE without duplicated elements."
(declare (optimize (speed 3) (safety 1) (debug 0)))
(cond ((listp sequence)
(remove-duplicates-list sequence start
end from-end test test-not key))
......@@ -595,7 +595,6 @@ Returns a copy of SEQUENCE without duplicated elements."
(test '#'eql) test-not
(start 0) (end (length sequence)) (from-end nil))
Destructive REMOVE-DUPLICATES. SEQUENCE may be destroyed."
(declare (optimize (speed 3) (safety 1) (debug 0)))
(cond ((listp sequence)
(delete-duplicates-list sequence start end from-end
test test-not key))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment