From: shevegen@... Date: 2019-09-06T08:39:26+00:00 Subject: [ruby-core:94795] [Ruby master Feature#16146] Array .difference allow custom comparison Issue #16146 has been updated by shevegen (Robert A. Heiler). Seems to be the same link as https://bugs.ruby-lang.org/issues/16118; so perhaps accidental double post; could close one of these two - or perhaps both. :D As there was not yet any comment on the other post, I'll comment briefly here. I think the standard way for custom comparisons in ruby is to define the strategy you wish to employ in order to compare e. g elements in an array. It's a bit short-sighted to think that one has to rely solely on .difference alone for that comparison. > such as #uniq but #difference does not :( If the issue is related between #uniq and #difference then I think the issue request should focus on precisely that part. This would make it easier for the ruby core team (respectively matz) to consider the merits (pro/con) of the suggestion itself. It's too difficult to try to understand what is meant in external sites otherwise, at the least I think it is. ---------------------------------------- Feature #16146: Array .difference allow custom comparison https://bugs.ruby-lang.org/issues/16146#change-81417 * Author: ngomez (Nancy Gomez) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Hello! I wanted to know if there's any plan to implement the ability to define comparison between individual items in arrays. Here is where I originally asked the question on Stack Overflow: https://stackoverflow.com/questions/57316775/is-there-any-way-to-specify-how-to-compare-of-array-of-objects-for-difference-f But specifically, I noticed nearly all the existing Array functions allow us to define ways for comparison, such as #uniq but #difference does not :( This is quite unfortunate but I'm hoping it's just because this function was introduced in 2.6.0, and hopefully this feature can be implemented? Thanks for any and all info :) -- https://bugs.ruby-lang.org/ Unsubscribe: