From 2f2d7ccaf1e11369140917e580abe4c73462d126 Mon Sep 17 00:00:00 2001 From: emarsden <emarsden> Date: Sun, 9 Feb 2003 17:36:08 +0000 Subject: [PATCH] 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. --- compiler/fndb.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/fndb.lisp b/compiler/fndb.lisp index a9a722c5c..b235a61ae 100644 --- a/compiler/fndb.lisp +++ b/compiler/fndb.lisp @@ -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)) -- GitLab