## [Sbcl-devel] partial explanation of bug 187

 [Sbcl-devel] partial explanation of bug 187 From: Alexey Dejneka - 2002-08-25 07:23:15 ```Set SB-C::*CHECK-CONSISTENCY* to T. (defknown %dvai (array index) ! (values t t) (foldable flushable)) (deftransform %dvai ((array index) (vector t) * :important t) (let* ((atype (continuation-type array)) (eltype (array-type-specialized-element-type atype))) ;; various checks skipped `(if (array-header-p array) ! (%wad array index nil) (values array index)))) (defoptimizer (%wad derive-type) ((array start end)) (let ((atype (continuation-type array))) (when (array-type-p atype) (values-specifier-type ! `(values (simple-array ,(type-specifier (array-type-specialized-element-type atype)) (*)) index index index))))) So, %DVAI returns two values, %WAD - four, and %DVAI = %WAD. But * (values-type-intersection (values-specifier-type '(values t)) (values-specifier-type '(values integer integer))) # T (and (values t) (values integer integer)) = (and (values t null) (values integer integer)) = (values (and t integer) (and null integer)) = (values integer nil) = nil so %WAD does not return. Having derived this wonderful fact, Python transforms the calling code into a mess. Replacing (%wad array index nil) with (multiple-value-bind (a i) (%wad array index nil) (values a i)) in DEFTRANSFORM %DVAI solves the problem. -- Regards, Alexey Dejneka --- CMUCL-specific packages: C: Python compiler. ```

 [Sbcl-devel] partial explanation of bug 187 From: Alexey Dejneka - 2002-08-25 07:23:15 ```Set SB-C::*CHECK-CONSISTENCY* to T. (defknown %dvai (array index) ! (values t t) (foldable flushable)) (deftransform %dvai ((array index) (vector t) * :important t) (let* ((atype (continuation-type array)) (eltype (array-type-specialized-element-type atype))) ;; various checks skipped `(if (array-header-p array) ! (%wad array index nil) (values array index)))) (defoptimizer (%wad derive-type) ((array start end)) (let ((atype (continuation-type array))) (when (array-type-p atype) (values-specifier-type ! `(values (simple-array ,(type-specifier (array-type-specialized-element-type atype)) (*)) index index index))))) So, %DVAI returns two values, %WAD - four, and %DVAI = %WAD. But * (values-type-intersection (values-specifier-type '(values t)) (values-specifier-type '(values integer integer))) # T (and (values t) (values integer integer)) = (and (values t null) (values integer integer)) = (values (and t integer) (and null integer)) = (values integer nil) = nil so %WAD does not return. Having derived this wonderful fact, Python transforms the calling code into a mess. Replacing (%wad array index nil) with (multiple-value-bind (a i) (%wad array index nil) (values a i)) in DEFTRANSFORM %DVAI solves the problem. -- Regards, Alexey Dejneka --- CMUCL-specific packages: C: Python compiler. ```