Closed chriseyre2000 closed 2 years ago
Just to be clear, your compare/2
is overriding the default behavior of comparison of a a 2-tuple?
I had no idea you could do that.
I also have no idea how to tackle this corner case...
It's one of the versions of Enum.sort, provide a module name with a compare function implemented in it. I am one of the crazy people who reads the documentation. It was intended to allow a struct to define how it is sorted, but here I am using it for a 2-tuple.
The lazy option would be to permit compare/2 to be defined if Enum.sort/2 is used.
I am also having trouble using this for the Poker exercise.
Here is my published solution that exhibits this issue: https://exercism.org/tracks/elixir/exercises/poker/solutions/chriseyre2000
Thank you for giving us more failing tests :)
Right now, I have 2 PRs lined up to fix #284 (in #287) and #276 (almost done but not pushed yet because it requires #287) that I would like to get done before tackling this issue. If you feel up to the task and you want to help, we could use a review on #287, it's a self-contained function, you don't need to know anything about the rest of the codebase.
Here is the code:
It raises the following warning: