[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

equalp for arrays



There appears to be a bug in akcl:

% kcl
AKCL (Austin Kyoto Common Lisp)  Thu Jan  7 16:37:30 PST 1988
Contains Enhancements by W. Schelter

>(lisp-implementation-version)
"June 3, 1987"

>(setf a (make-array '(2 2) :element-type 'fixnum
                            :initial-contents '( (1 2) (3 4) )))
#2A((1 2) (3 4))

>(setf b (make-array '(2 2) :element-type 'fixnum
                            :initial-contents '( (1 2) (3 4) )))
#2A((1 2) (3 4))

>(equalp a b)
NIL


The equalp should return T.

I believe the bug is in the file c/predicate.c in the routine equalp:
Approximately lines 487-492 of KCL or lines 504-509 or AKCL:

	case t_array:
		if (ty == t_array && x->a.a_rank != y->a.a_rank)
			goto ARRAY;
		else
			return(FALSE);
	}

The if statement should read:

		if (ty == t_array && x->a.a_rank == y->a.a_rank)


David Lim
Arpanet: david@ametek.com
UUCP: ...!ucbvax!sun!megatest!ametek!david
      ...!cit-vax!ametek!david