-
Notifications
You must be signed in to change notification settings - Fork 36
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
init
keyword for reducec
and mapreducec
#247
Comments
I agree with the support of the keyword argument mapreducec((a, b) -> max(a, b), *, Gray(1), Gray(0)) # Does `Gray(1)` mean the `v0`? I don't think this is much of a problem in the current situation. However, issue #207 needs to be considered more carefully. BTW, this isn't an essential issue, but the default value of julia> mapreduce(identity, +, (1.0, 0.5, 0.25))
1.75
julia> mapreduce(identity, +, (1.0, 0.5, 0.25), init=0)
1.75
julia> mapreduce(identity, *, (1.0, 0.5, 0.25))
0.125
julia> mapreduce(identity, *, (1.0, 0.5, 0.25), init=1)
0.125 |
I also set one of the milestones for v0.13 to be the provision of iterator interfaces (cf. #131 (comment)) julia> components(c::Color3) = (comp1(c), comp2(c), comp3(c)); # substitute a tuple for an iterator object
julia> mapreduce(identity, *, components(RGB(1.0, 0.5, 0.25)))
0.125
julia> mapreducec(identity, *, 1.0, RGB(1.0, 0.5, 0.25))
0.125
|
Even if we may deprecate The ability to omit the initial value is more attractive than the ability to explicitly specify the |
The current API is not consistent with
reduce
/mapreduce
.Maybe, we can just make
mapc
/reducec
/mapreducec
as Colorant methods ofmap
/reduce
/mapreduce
?The text was updated successfully, but these errors were encountered: