GNU bug report logs - #10252
bugs in array-map!, array-for-each, others

Previous Next

Package: guile;

Reported by: Daniel Llorens <daniel.llorens <at> bluewin.ch>

Date: Thu, 8 Dec 2011 19:28:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 10252-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Daniel Llorens <daniel.llorens <at> bluewin.ch>
Cc: 10252-done <at> debbugs.gnu.org
Subject: Re: bug#10252: bugs in array-map!, array-for-each, others
Date: Thu, 22 Dec 2011 17:17:56 -0500
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/




This bug report was last modified 13 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.