bug in Array2D's rowAndColumnValuesDo: ?
Evan Martin
martine at cs.washington.edu
Tue Mar 19 23:00:02 UTC 2002
I was recently introduced to Squeak as a project in a CS class
(http://www.cs.washington.edu/341 -- programming languages).
I used the Array2D class in one of my projects, and encounted a small
problem. The following simple code causes an error in Squeak within the
Array2D's method rowAndColumnValuesDo:
a _ Array2D width: 10 height: 5. "width must be greater than height"
a rowAndColumnValuesDo: [ :row :col :value | Transcript show: value. ].
Some digging revealed that the rowAndColumnValuesDo: method incorrectly
calls
self at: row at: col
while the at:at: method is documented as returning the element at x, y.
Unless my conception of the coordinate system is wrong, row corresponds
to the y coordinate, so the proper code in rowAndColumnValuesDo: should
be
self at: col at: row
(I'm not on the list, so feel free to CC me any responses. I'm also
pretty new to Squeak, so I apologize in advance if I mangled some
terminology / reported something that's already well-known / did
something else wrong.)
--
Evan Martin
martine at cs.washington.edu
http://neugierig.org
More information about the Squeak-dev
mailing list
|