bug-guile
[Top][All Lists]
Advanced

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

bug#10252: bugs in array-map!, array-for-each, others


From: Andy Wingo
Subject: bug#10252: bugs in array-map!, array-for-each, others
Date: Thu, 22 Dec 2011 17:17:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]