On Mon, Aug 26, 2002 at 08:25:56AM +0400, Alexey Dejneka wrote:
> It seems that Python treats free type declarations as
> (declaim (optimize (speed 0) (safety 3)))
> (defun f (x)
> (declare (real x))
> (+ x
> (locally (declare (single-float x))
> (sin x))))
> For this function SBCL generates type check for REAL, but not for
> SINGLE-FLOAT. So (F NIL) gives type error, which is right, but (F 100)
> on my machine results in segmentation violation.
I ran into something like this by accident a long time ago. IIRC
it involved declaring the wrong variable inside a DOTIMES loop,
so that the declaration was treated as a free declaration instead
of an ordinary declarations-are-assertions declaration.
(declaim (optimize (speed 1) (safety 3)))
(defun trust-assertion (i)
(dotimes (j i)
(declare (type (mod 4) i)) ; when commented out, behavior changes!
(unless (< i 5)
I consider this a serious bug -- declarations should be assertions! --
but it wasn't obvious to me how to fix it.
I think this came up so long ago that there was no BUGS file to stuff
it in. Some discussion of it is probably on the cmucl-* mailing list
archives somewhere, since I brought it up there hoping it would be
obvious to someone else how to fix it.:-)
I've logged your test case and mine as bugs 192a and 192b.
William Harold Newman <william.newman@...>
"It is surprising that we did as little damage as we did."
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C