[babel-devel] [PATCH] elide note when compiling BOM-VECTOR

Tobias C. Rittweiler tcr at freebits.de
Mon Jun 1 12:59:38 UTC 2009


Compiling BOM-VECTOR emits a "type assertion to complex to check note."
The reason is that (THE FOO (QUUX)) is actually of type (VALUES FOO
&REST T) which SBCL, at least for the moment, cannot cope well with.
The below patch changes it to (THE FOO (VALUES (QUUX))).

  -T.

diff -rN -u old-babel/src/strings.lisp new-babel/src/strings.lisp
--- old-babel/src/strings.lisp	2009-06-01 14:58:56.000000000 +0200
+++ new-babel/src/strings.lisp	2009-06-01 14:58:56.000000000 +0200
@@ -237,15 +237,16 @@
 (defun bom-vector (encoding use-bom)
   (check-type use-bom (member :default t nil))
   (the simple-vector
-    (if (null use-bom)
-        #()
-        (let ((enc (typecase encoding
-                     (external-format (external-format-encoding encoding))
-                     (t (get-character-encoding encoding)))))
-          (if (or (eq use-bom t)
-                  (and (eq use-bom :default) (enc-use-bom enc)))
-              (enc-bom-encoding enc)
-              #())))))
+    (values
+     (if (null use-bom)
+         #()
+         (let ((enc (typecase encoding
+                      (external-format (external-format-encoding encoding))
+                      (t (get-character-encoding encoding)))))
+           (if (or (eq use-bom t)
+                   (and (eq use-bom :default) (enc-use-bom enc)))
+               (enc-bom-encoding enc)
+               #()))))))
 
 (defun string-to-octets (string &key (encoding *default-character-encoding*)
                          (start 0) end (use-bom :default)






More information about the babel-devel mailing list