Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007326 [Squeak] Collections minor always 03-31-09 02:41 02-06-11 23:48
Reporter lucian3 View Status public  
Assigned To leves
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version trunk Product Version
  Product Build
Summary 0007326: #sum and #average do not work properly with empty collections
Description Sending #sum or #average to an empty collection will yield an "attempt to index non-existent element..." error. #sum and #average should check first to see if the collection is empty and then, if it is, either return zero (my preferred behavior) or raise a more appropriate error.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0013908 - 54 - 54 - 54 - 54 - 54 - 54)
leves
11-07-10 02:21

This was solved by reimplementing #sum using #reduce:.
 

- Issue History
Date Modified Username Field Change
03-31-09 02:41 lucian3 New Issue
11-07-10 02:21 leves Status new => resolved
11-07-10 02:21 leves Fixed in Version  => trunk
11-07-10 02:21 leves Resolution open => fixed
11-07-10 02:21 leves Assigned To  => leves
11-07-10 02:21 leves Note Added: 0013908
02-06-11 23:48 leves Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
37 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker