From: zverok.offline@... Date: 2019-11-11T15:26:18+00:00 Subject: [ruby-core:95793] [Ruby master Feature#16341] Proposal: Set#to_proc Issue #16341 has been updated by zverok (Victor Shepelev). Fair enough. ...well, you still can ```ruby pets.count(&dogs.:include?) ``` until the core team haven't reverted it :)))) (Which, for me, is more clear than value-objects-suddenly-becoming-procs, but apparently it is only me) ---------------------------------------- Feature #16341: Proposal: Set#to_proc https://bugs.ruby-lang.org/issues/16341#change-82614 * Author: Nondv (Dmitry Non) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- ``` ruby class Set def to_proc -> (x) { include?(x) } # or method(:include?).to_proc end end ``` Usage: ```ruby require 'set' banned_numbers = Set[0, 5, 7, 9] (1..10).reject(&banned_numbers) # ===> [1, 2, 3, 4, 6, 8, 10] ``` -- https://bugs.ruby-lang.org/ Unsubscribe: