On Mon, Nov 29, 2010 at 12:26:47PM +0200, Nikodemus Siivola wrote:
> On 29 November 2010 10:16, Peter Keller <psilord@...> wrote:
> > It apparently seems that under some conditions, but not all,
> > if SBCL notices that the value of the variable can't possibly be
> > used, it doesn't even try to evaluate it. This is, in my opinion,
> > erroneous, since it will also fail to signal the unbound-variable
> > condition.
> SBCL *should* preserve references to non-local variables whose value
> is unused when SAFETY is 3. The language in the CLHS is "should be
> signaled" which means the error is required only for safe code -- and
> SBCL uses this freedom to eliminate the variable reference if its
> value is unused.
> (Note that default SAFETY is 1.)
> If you make your read-macro produce
> (locally (declare (optimize safety))
> does the elimination still happen?
I tried your suggesstion, but it still did not work as intended.
> If it does, even a large example that demonstrate the issue is most
> welcome, since that sounds like an SBCL bug.
I've produced a tarball which exhibits this behavior. After you untar
it, read the README, which will hopefully explain what you need to know
and how to reproduce the problem and how it looks when it works with
One minor addendum is that if you add (safety 3) in the declaim at the top
of pic/pic-instruction-sets/12-bit/12-bit.lisp, you still get the problem.
If you have any questions, please let me know.