Skip to content
Snippets Groups Projects
Commit 2f2d7cca authored by emarsden's avatar emarsden
Browse files

Tell the compiler that READ-DELIMITED-LIST always returns a list.

Compiling the following function generates an efficiency note; with
the patch the note disappears.

  (defun foo ()
    (declare (optimize speed))
    (let* ((stream (make-string-input-stream "0 1 2 3)"))
           (read (read-delimited-list #\) stream)))
      (find 2 read)))

; (find 2 read)
; Note: Unable to optimize due to type uncertainty:
; The second argument is a (or null vector cons), not a simple-base-string.

Problem and fix from Tony Martinez via SBCL.
parent 5185ba67
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/fndb.lisp,v 1.103 2003/01/29 03:20:31 toy Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/fndb.lisp,v 1.104 2003/02/09 17:36:08 emarsden Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -854,7 +854,7 @@
(defknown (read read-preserving-whitespace read-char-no-hang read-char)
(&optional streamlike t t t) t (explicit-check))
(defknown read-delimited-list (character &optional streamlike t) t
(defknown read-delimited-list (character &optional streamlike t) list
(explicit-check))
(defknown read-line (&optional streamlike t t t) (values t boolean)
(explicit-check))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment