ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: marcandre-ruby-core@marc-andre.ca
To: ruby-core@ruby-lang.org
Subject: [ruby-core:103301] [Ruby master Feature#15198] Array#intersect?
Date: Thu, 08 Apr 2021 12:32:02 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-91386.20210408123201.16080@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15198.20181003200703.16080@ruby-lang.org

Issue #15198 has been updated by marcandre (Marc-Andre Lafortune).

Assignee set to matz (Yukihiro Matsumoto)

I am positive on the feature as has valid use cases, it can be optimized in C and as a bonus adds no cognitive load.

I believe we just need a final "yay" from Matz. I'll add it to the next meeting's agenda.

----------------------------------------
Feature #15198: Array#intersect?
https://bugs.ruby-lang.org/issues/15198#change-91386

* Author: c4am95 (Travis Hunter)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
I frequently find myself needing to determine if two arrays intersect but not actually caring about the intersection, so I write code like:
~~~ ruby
(a1 & a2).any?
~~~

It would be nice to have an **intersect?** convenience method on **Array** to perform this query.

[ruby#1972: Add Array#intersect?](https://github.com/ruby/ruby/pull/1972)



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2021-04-08 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15198.20181003200703.16080@ruby-lang.org>
2021-04-07 19:17 ` [ruby-core:103278] [Ruby master Feature#15198] Array#intersect? c4am95
2021-04-08 12:32 ` marcandre-ruby-core [this message]
2021-04-16  6:56 ` [ruby-core:103474] " matz
2021-04-16  7:03 ` [ruby-core:103475] " knu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-91386.20210408123201.16080@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).