Anonymous | Login | 01-15-2021 18:04 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0006364 | [Squeak] Collections | minor | always | 03-21-07 18:23 | 04-18-10 21:59 | ||||
Reporter | bfowlow | View Status | public | ||||||
Assigned To | nicolas cellier | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.8 | ||||||
Summary | 0006364: Collections ifEmpty: returns nil on non-empty | ||||||||
Description |
Collection ifEmpty: [ foo ] returns nil if the collection is not empty, owing to the placement of the return in ifEmpty: aBlock "Evaluate the block if I'm empty" ^ self isEmpty ifTrue: aBlock It would be (I think) more useful to say ifEmpty: aBlock self isEmpty ifTrue: [ ^ aBlock value ] returning the original collection if non-empty, ... since this allows expressions such as foo := (collection allAfterLast:'@') ifEmpty: [collection]. |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
![]() |
|
(0013432 - 49 - 49 - 49 - 49 - 49 - 49) nicolas cellier 12-12-09 18:28 |
resolved in trunk by Levente (Collections-ul.186) |
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
38 total queries executed. 32 unique queries executed. |