Project

General

Profile

Actions

Feature #16118

open

Array .difference allow custom comparison

Added by ngomez (Nancy Gomez) over 4 years ago. Updated about 2 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:94486]

Description

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 :)

Actions #1

Updated by ngomez (Nancy Gomez) over 4 years ago

  • Subject changed from Array .distance allow custom comparison to Array .difference allow custom comparison
Actions #2

Updated by hsbt (Hiroshi SHIBATA) about 2 years ago

  • Project changed from 14 to Ruby master
Actions

Also available in: Atom PDF

Like0
Like0Like0