Hi, all.
I had a problem when using vector-fill! to fill a dimension of 2D array.
Here is my code. Please note the second section of the code. First it
generate a 2x2 array with nested make-vector. Then, it called
vector-fill! to fill the second row of the array with value 10. But it
turns out that the whole 2x2 array is filled with 10.
Running the code under mzscheme works out the same result. Is it a bug?
Or is there something wrong with my code? Could anybody help? Thanks.
[EMAIL PROTECTED]:~/code$ cat fill.scm
(define v '#(#(1 3) #(2 4)))
(display v)(newline)
(vector-fill! (vector-ref v 1) 10)
(display v)(newline)
(set! v (make-vector 2 (make-vector 2 1)))
(display v)(newline)
(vector-fill! (vector-ref v 1) 10)
(display v)(newline)
[EMAIL PROTECTED]:~/code$ guile -s fill.scm
#(#(1 3) #(2 4))
#(#(1 3) #(10 10))
#(#(1 1) #(1 1))
#(#(10 10) #(10 10))
[EMAIL PROTECTED]:~/code$ mzscheme.exe -fvm fill.scm
#(#(1 3) #(2 4))
#(#(1 3) #(10 10))
#(#(1 1) #(1 1))
#(#(10 10) #(10 10))
--
Ding Haifeng
[EMAIL PROTECTED]
2007-09-04
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user