We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
summing an empty iterator using sum() returns error instead of zero(eltype()).
discussion on google-groups: https://groups.google.com/forum/#!topic/julia-users/xLde2t7PsgU
suggested fix by Mauro:
Modifying mapflodl in reduce.jl would make sum work:
function mapfoldl(f, op, itr) i = start(itr) if done(itr, i) return Base.mr_empty(f, op, eltype(itr)) # instead of: error("Argument is empty.") end (x, i) = next(itr, i) v0 = evaluate(f, x) mapfoldl_impl(f, op, v0, itr, i) end
The text was updated successfully, but these errors were encountered:
b674eed
reduce
foldr
foldl
No branches or pull requests
summing an empty iterator using sum() returns error instead of zero(eltype()).
discussion on google-groups: https://groups.google.com/forum/#!topic/julia-users/xLde2t7PsgU
suggested fix by Mauro:
The text was updated successfully, but these errors were encountered: