From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 6E3CB19C0032 for ; Wed, 4 Nov 2015 13:56:09 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id E307BB5D977 for ; Wed, 4 Nov 2015 14:24:56 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id E4EE3952408 for ; Wed, 4 Nov 2015 14:24:56 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 41B031204C1; Wed, 4 Nov 2015 14:24:55 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 0FE82120485 for ; Wed, 4 Nov 2015 14:24:50 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=P+sekySXMrpYmw/j/AoSAs1QtTA=; b=bs6RVA4XTC8JcYnbJE DCqwMZwaSq56WhRpIHvgsM7UAPACVHRl+ZigMM5TKumRACemTw3jSuWDjgvGIx4L vB42QXZc4JgasNOZ80MPDqnqMmTM5Fd8nfwkjv2xy7ml5x+QFSlbm2ullpgPoYBB Kh0lwm4MSBoeVCjdvM2ciiejA= Received: by filter0668p1mdw1.sendgrid.net with SMTP id filter0668p1mdw1.15678.5639969C1C 2015-11-04 05:24:44.08483863 +0000 UTC Received: from herokuapp.com (ec2-54-166-23-0.compute-1.amazonaws.com [54.166.23.0]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id ydRgYSeCQ8ebOR2nd2nsLg for ; Wed, 04 Nov 2015 05:24:44.738 +0000 (UTC) Date: Wed, 04 Nov 2015 05:24:44 +0000 From: duerst@it.aoyama.ac.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Redmine-MailingListIntegration-Message-Ids: 45969 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11653 X-Redmine-Issue-Author: danielpclark X-Redmine-Issue-Assignee: matz X-Redmine-Sender: duerst X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4f5veiUQ/MDH6VeD9+z90gb/ukUzqqzmqrNU rxObw5z8jsTiqP39OZCs1ymkqN6gMPlskuXI+VANzkN7r5gJNZ0+GB4pBz13K2HKYHiRcY4+t/97Zy XSUYkGWlMgtCISKbnOy6wXx0trr2a79ZZiQH X-ML-Name: ruby-core X-Mail-Count: 71329 Subject: [ruby-core:71329] [Ruby trunk - Feature #11653] Add to_proc on Hash X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11653 has been updated by Martin D=C3=BCrst. Assignee set to Yukihiro Matsumoto I think this is an excellent idea. I hope this can make it into Ruby 2.3. ---------------------------------------- Feature #11653: Add to_proc on Hash https://bugs.ruby-lang.org/issues/11653#change-54703 * Author: Daniel P. Clark * Status: Open * Priority: Normal * Assignee: Yukihiro Matsumoto ---------------------------------------- Procs can be called the same way a hash is with `[]`. But a Hash is not ma= ppable as a Proc. my_hash =3D ->key{{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }[key]} my_hash[:a] # =3D> 1 [:e, :a, :b, :f, :c, :d].map(&my_hash) # hash is now mappable # =3D> [5, 1, 2, 6, 3, 4] This seems so straight forward I believe it should be part of the language = itself with the .to_proc method call. --=20 https://bugs.ruby-lang.org/