[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] numberOfEmptySlots
From: |
Gabriel Dos Reis |
Subject: |
Re: [Axiom-developer] numberOfEmptySlots |
Date: |
09 Aug 2007 21:06:07 -0500 |
Gabriel Dos Reis <address@hidden> writes:
| Consider the following function from src/interp/clam.boot:
|
| numberOfEmptySlots cache==
| count:= (CAAR cache ='$failed => 1; 0)
| for x in tails rest cache while NE(x,cache) repeat
| if CAAR x='$failed then count:= count+1
| count
|
|
| The SBCL type checker does not like it because:
|
| * it is able to infer that cache is a list,
| * '=' (coming from NE, which mean not =) can be applied only
| to numbers.
|
| Consequently, we have conflicting assumptions for the same value. So, we
| have a bug. Now, looking back at the code, the expression
|
| NE(x,cache)
|
| cannot be right. Was it indended to be
|
| x /= cache
|
| instead?
Looking more into it, I suspect it was supposed to be
NEQ(x,cache)
where NEW is the macro (from vmlisp.lisp)
(defmacro neq (a b) `(not (eq ,a ,b)))
-- Gaby