[ENH] Re: Doesn't anyone use Array2D?

Michael Rueger m.rueger at acm.org
Thu Apr 6 02:30:53 UTC 2000


"Allen L. Mann" wrote:
> I'm a newbie trying to use Array2D (Squeak 2.7) to solve an electricity &
> magnetism problem via the relaxation method. So far, I've had to
> reimplement such basic methods as copy and size. Hasn't anyone used Array2D
> since tk modified it in 1996? Is there some better way that everyone uses
> so that Array2D is justifiably neglected?

I used it ;-)

I'm attaching the changes I added to Array2D, nothing fancy, just some
useful methods.

Michael
-------------- next part --------------
'From Squeak2.8alpha of 26 January 2000 [latest update: #1854] on 14 February 2000 at 1:17:36 pm'!

!Array2D methodsFor: 'enumerating' stamp: 'mir 2/14/2000 12:42'!
rowAndColumnValuesDo: aBlock
	1 to: self width do: [:col |
		1 to: self height do: [:row |
			aBlock value: row value: col value: (self at: row at: col)]]! !

!Array2D methodsFor: 'enumerating' stamp: 'mir 2/14/2000 12:41'!
rowsAndColumnsDo: aBlock
	1 to: self width do: [:col |
		1 to: self height do: [:row |
			aBlock value: row value: col]]! !


!Array2D class reorganize!
('instance creation' extent: new new:)
!


!Array2D class methodsFor: 'instance creation' stamp: 'mir 2/14/2000 12:34'!
extent: aPoint
	^self new width: aPoint x height: aPoint y type: Array! !




More information about the Squeak-dev mailing list