From: mail@... Date: 2014-10-02T18:45:02+00:00 Subject: [ruby-core:65373] [ruby-trunk - Feature #10318] [Open] [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable. Issue #10318 has been reported by gogo tanaka. ---------------------------------------- Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable. https://bugs.ruby-lang.org/issues/10318 * Author: gogo tanaka * Status: Open * Priority: Normal * Assignee: * Category: * Target version: Next Major ---------------------------------------- I���m so sorry for just proposing this future without PATCH right now ... (I suppose it contains too much issues.) After some discussions, let me implement this future. Of course I need to obtain your consent. Anyway, I want to let underscore be positionally matched arg and omit to binding obvious variable when it comes to proc, lambda and block . ``` # let items be a Array of String. (e.g. items = ['foo', 'bar', 'foobar'] # Before items.select { |item| item.include?('foo') } # After items.select { _.include?('foo') } ``` Even if block has more than 2 args, I want to omit one of them. (I know it has much pain ... just idea) ``` # let nums be a Array of Integer. (e.g. nums = [1, 2, 3, 4] # Before nums.inject { |sum, num| sum + num } # After nums.inject { |sum| sum + _ } #��� It seems to difficult to hundle .. but looks aesthetic or understandable. ``` Let me know how do you think about it or what problem is. thank you. gogo. -- https://bugs.ruby-lang.org/