[squeak-dev] The Trunk: Collections-tonyg.971.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Dec 23 20:28:09 UTC 2021
Tony Garnock-Jones uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-tonyg.971.mcz
==================== Summary ====================
Name: Collections-tonyg.971
Author: tonyg
Time: 23 December 2021, 3:28:05.944561 pm
UUID: 0c4855b6-dd88-4b87-bb0c-7b07120d8364
Ancestors: Collections-tonyg.970
Allow extraction of a Matrix column even when there are no rows in the matrix.
=============== Diff against Collections-tonyg.970 ===============
Item was changed:
----- Method: Matrix>>atColumn: (in category 'accessing rows/columns') -----
atColumn: column
|p|
+ nrows = 0 ifTrue: [
+ (column between: 1 and: ncols)
+ ifFalse: [self error: '2nd subscript out of range'].
+ ^ #()].
-
p := (self indexForRow: 1 andColumn: column)-ncols.
^(1 to: nrows) collect: [:row | contents at: (p := p+ncols)]
!
More information about the Squeak-dev
mailing list
|