X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsharpm.lisp;h=39c8e66ce1be9b66a5500bca95a19bbe0f60214a;hb=b7de1001e4c2602174506d875e1c1460258fbc07;hp=758114ffa198150f3b34ad6ad8aac053227649e5;hpb=678a5d0cd5bfccf621e11147507471c3f511595c;p=sbcl.git diff --git a/src/code/sharpm.lisp b/src/code/sharpm.lisp index 758114f..39c8e66 100644 --- a/src/code/sharpm.lisp +++ b/src/code/sharpm.lisp @@ -21,32 +21,32 @@ (defun sharp-left-paren (stream ignore length) (declare (ignore ignore) (special *backquote-count*)) (let* ((list (read-list stream nil)) - (listlength (handler-case (length list) - (type-error - (error) - (declare (ignore error)) - (simple-reader-error stream - "improper list in #(): ~S" - list))))) + (list-length (handler-case (length list) + (type-error () + (simple-reader-error stream + "Improper list in #(): ~S." + list))))) (declare (list list) - (fixnum listlength)) + (fixnum list-length)) (cond (*read-suppress* nil) + ((and length (> list-length length)) + (simple-reader-error + stream + "Vector longer than the specified length: #~S~S." + length list)) ((zerop *backquote-count*) (if length - (cond ((> listlength (the fixnum length)) - (simple-reader-error - stream - "vector longer than specified length: #~S~S" - length list)) - (t - (fill (the simple-vector - (replace (the simple-vector - (make-array length)) - list)) - (car (last list)) - :start listlength))) + (fill (replace (make-array length) list) + (car (last list)) + :start list-length) (coerce list 'vector))) - (t (cons *bq-vector-flag* list))))) + (t + (cons *bq-vector-flag* + (if length + (append list + (make-list (- length list-length) + :initial-element (car (last list)))) + list)))))) (defun sharp-star (stream ignore numarg) (declare (ignore ignore))