-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Comparison operator in findmin() variants #14216
Comments
It should probably be like |
@stevengj I'm planning to add just this option for now, others can contribute more options in the future if they find it useful. Can I move forward and send a PR? |
Actually I'm not sure if that is a good addition. From one side it looks like an useful option, from the other side I think one can always convert the set of objects to a numeric score with a simple map, apply What is more Julian and clean? |
Yes, I am closing this one as non-Julian. |
Actually, I think |
You are assuming that each collection is indexable. This doesn't work e.g. with dictionaries: julia> d = Dict(3=>'a', 2=>'b')
Dict{Int64,Char} with 2 entries:
2 => 'b'
3 => 'a'
julia> findmin(d)
(2=>'b',1)
julia> d[1]
ERROR: KeyError: 1 not found That is, one first has to convert the dictionary to an array while converting the element types, then apply |
Agreed. I'll send the PR soon.
…-Júlio
|
@juliohm, please look at how |
@stevengj could you please add the label |
Lovely meeting you last week Julio! :) I added the up for grabs label, but forewent adding the intro issue label (which I am not certain is accurate for this project). Best! |
The same Sacha! Thanks for adding the label, we should set a meetup at Stanford for Julia users at some point. :) Best! |
I believe this issue is being addressed somewhere else already for Julia v0.7? If it is a duplicate, could you please close it? |
I'm not aware of changes which would have fixed this at this point. |
Thank you @nalimilan, plans to address this issue in your recent PR (#24673) or in the 1.0 milestone? |
No, the priority for 0.7 is to make the API consistent, new features can be added later. |
Makes sense, this issue can be viewed as a new feature since the option is not implemented yet. |
Maybe we could add this issue to some milestone? Like Julia 1.2? |
If somebody does the work it can be merged at any point, but we use time-based releases rather than feature-based releases. |
This issue was raised in the mailing list: https://groups.google.com/forum/#!topic/julia-users/iBydnBqQgxg
Although we can define a custom type and specialize the
<
operator for it, sometimes we may be interested in testing different operators on the spot. What are your thoughts on an additional option a la C++?The text was updated successfully, but these errors were encountered: