On Sat, 15 Sep 2007, Waldek Hebisch wrote:

| > 
| > 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

[...]

| > cannot be right.  Was it indended to be
| > 
| >     x /= cache
| > 
| > instead?
| > 
| > Note: a /= b is almost same like (not (equal a b)).
| > 
| 
| The problem is due to incomplete conversion form old Boot to Shoe.
| Originally clam.boot was translated by old Boot and NE was passed
| unmolested to Lisp output.  In vmlisp.lisp we have:
| 
| (defmacro ne (a b) `(not (equal ,a ,b)))
| 
| so original meaning was (not (equal x cache)).  Shoe changes
| NE to /= leading to error...

I still believe the code is incorrect if `not equal' is intented.
The condition in the loop is testing whether x does not contain
itself.  If equal is used, then I suspect that will end up with
an infinite loop.  Rather, I suspect it should have been `not eq'.

-- Gaby


_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to