X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fstring.lisp;h=b1fe4875422e62b715120c47153d585826fc772b;hb=01044af1b8d69fc3899dc0417064c1512223223d;hp=cc32c65ba56efd3f1f37fd23ff03838760ece43e;hpb=1bbb76fcfb9baddf0dc96412c87575d8aeb69c6d;p=sbcl.git diff --git a/src/code/string.lisp b/src/code/string.lisp index cc32c65..b1fe487 100644 --- a/src/code/string.lisp +++ b/src/code/string.lisp @@ -23,7 +23,7 @@ (t (error 'simple-type-error :datum x - :expected-type 'stringable + :expected-type 'string-designator :format-control "~S cannot be coerced to a string." :format-arguments (list x))))) @@ -37,13 +37,7 @@ ;;; strings in the unasterisked versions and using this in the ;;; transforms conditional on SAFETY>SPEED,SPACE). (defun %check-vector-sequence-bounds (vector start end) - (declare (type vector vector) - (type index start) - (type (or index null) end)) - (let ((length (length vector))) - (if (<= 0 start (or end length) length) - (or end length) - (signal-bounding-indices-bad-error string start end)))) + (%check-vector-sequence-bounds vector start end)) (eval-when (:compile-toplevel) ;;; WITH-ONE-STRING is used to set up some string hacking things. The @@ -348,19 +342,16 @@ (using char-equal) of the two strings. Otherwise, returns ()." (string-not-greaterp* string1 string2 start1 end1 start2 end2)) -(defun make-string (count &key element-type ((:initial-element fill-char))) +(defun make-string (count &key + (element-type 'character) + ((:initial-element fill-char))) #!+sb-doc "Given a character count and an optional fill character, makes and returns - a new string Count long filled with the fill character." - (declare (fixnum count) - (ignore element-type)) + a new string COUNT long filled with the fill character." + (declare (fixnum count)) (if fill-char - (do ((i 0 (1+ i)) - (string (make-string count))) - ((= i count) string) - (declare (fixnum i)) - (setf (schar string i) fill-char)) - (make-string count))) + (make-string count :element-type element-type :initial-element fill-char) + (make-string count :element-type element-type))) (flet ((%upcase (string start end) (declare (string string) (index start) (type sequence-end end))