Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • emarsden's avatar
    2f2d7cca
    Tell the compiler that READ-DELIMITED-LIST always returns a list. · 2f2d7cca
    emarsden authored
    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.
    2f2d7cca
    History
    Tell the compiler that READ-DELIMITED-LIST always returns a list.
    emarsden authored
    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.