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 9222617DB6C8 for ; Wed, 4 Nov 2015 11:30:39 +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 78604B5D929 for ; Wed, 4 Nov 2015 11:59:26 +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 67BA7952443 for ; Wed, 4 Nov 2015 11:59:26 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 28C2F12050F; Wed, 4 Nov 2015 11:59:24 +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 EF70D120496 for ; Wed, 4 Nov 2015 11:59:20 +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=reOqGnwSBLcwiOA2J2ZGmS9evwQ=; b=R2Ve5Dtw+ZwewbKvEs KefmTdFiA+JObE1f/Ypi2qz2OEqLDoXbvgncYY0NoNYfoxmQ7u+Y8bW477mK7nxA kbeOm43ez+EowIpNL29ma1IPjGpkfP6jR+ezKKLR7A7fuc7sU5big0cdARU6PReH iR04pNNTMwlKu/j3YwWWOU/0g= Received: by filter0539p1mdw1.sendgrid.net with SMTP id filter0539p1mdw1.5137.56397484B 2015-11-04 02:59:16.0777269 +0000 UTC Received: from herokuapp.com (ec2-54-91-142-8.compute-1.amazonaws.com [54.91.142.8]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id 3tKJrkO6R9ebx8PfrYDVXA for ; Wed, 04 Nov 2015 02:59:16.232 +0000 (UTC) Date: Wed, 04 Nov 2015 02:59:16 +0000 From: 6ftdan@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45967 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11653 X-Redmine-Issue-Author: danielpclark X-Redmine-Sender: danielpclark 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6VVNSwLyVINIgKxfMknX3SImRIh3aRxM+rm3 aDi5yOrAvjo5KpfJI1Gg1NWqzM8YkKAqYRg1I5EJaMi/0KmeYrsw3KjMv76TXWITafcWzNiMRJ7dG/ +TTwC53Mnvihre4= X-ML-Name: ruby-core X-Mail-Count: 71327 Subject: [ruby-core:71327] [Ruby trunk - Feature #11653] [Open] 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 reported by Daniel P. Clark. ---------------------------------------- Feature #11653: Add to_proc on Hash https://bugs.ruby-lang.org/issues/11653 * Author: Daniel P. Clark * Status: Open * Priority: Normal * Assignee: ---------------------------------------- Procs can be called the same way a hash is with `[]`. But a Hash is not mappable as a Proc. my_hash = ->key{{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }[key]} my_hash[:a] # => 1 [:e, :a, :b, :f, :c, :d].map(&my_hash) # hash is now mappable # => [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. -- https://bugs.ruby-lang.org/