Subject: Re: bug#10252: bugs in array-map!, array-for-each, others
From: Andy Wingo <[email-masked]>
To: Daniel Llorens <[email-masked]>
Cc: [email-masked]
Date: Thu, 22 Dec 2011 17:17:56 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Daniel!

Very interestingly, this bug was totally backwards: they problem wasn't
in array-map!, it was in generalized-vector-ref (and -set!).  I fixed
that bug:

> ; generalized-vector-ref / set! is broken.
>
> (define (array-row a i)
>   (make-shared-array a (lambda (j) (list i j))
>                        (cadr (array-dimensions a))))
> (define nn #2u32((0 1) (2 3)))
>
> (array-ref (array-row nn 1) 0)
> (generalized-vector-ref (array-row nn 1) 0)

and the array stuff fixed itself.  Neat, eh?  I added your tests, just
to make sure we don't break it in the future.

I did not make the array-for-each change, as besides changing public
API, it is unclear to me why we would want to allow (array-for-each
proc) to work, as we don't allow (for-each proc) to work.

Anyway, please submit a new patch or bug if you think it is the sensible
thing to do, and we can talk about it more.

Again, thanks for the patch!

Andy
-- 
http://wingolog.org/