Kevin Ryde <[EMAIL PROTECTED]> writes: > Marius Vollmer <[EMAIL PROTECTED]> writes: >> >> It should clearly be possible to use equal? with all kinds of arrays. >> If this isn't the case, we would need to fix. > > Eg, picking out a diagonal with a shared array: > > (equal? (make-shared-array #2((a b c) (d e f) (g h i)) > (lambda (i) (list i i)) > '(0 2)) > #(a e i)) > => #f > > but with array-equal? it's #t. > > It was this way in guile 1.6 too, but never really documented under > equal?, unless you know or thought a shared array is not really an > array.
The problem is that #(a e i) is a vector (scm_tc7_vector) while make-shared-array returns a smob. In Guile 1.6, you could not use vector-ref with a one-dimensional array smob (but you could use array-ref with a vector). Thus, you could say that a one-dimensional array is not a vector and can not be equal to it. It also prints differently. In Guile 1.8, you can use vector-ref with a one-dimensional array smob, and they print identical. Thus, they should be equal? now. I'll fix this. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel