-
-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sum: should work with empty collection #6373
Comments
So just adding a self isEmpty ifTrue: [^ 0 ] would make it a lot more usable |
Here we go again ... (And it totally agree: https://en.wikipedia.org/wiki/Empty_sum) |
thanks! |
What about adding sum:ifEmpty:?
|
I find that Wikipedia article hard to follow. I think this is a simpler explanation in favour...
|
Yes vincent I like your idea! |
#() sum: #linesOfCode should return 0.
right now it forces all the clients to check if the receiver is empty.
If we do not fix it, we should remove it and the user uses inject:into:
The text was updated successfully, but these errors were encountered: