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 C42FF19C003C for ; Mon, 9 Nov 2015 16:38:42 +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 AB02AB5D89B for ; Mon, 9 Nov 2015 17:08:09 +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 29C0218CC7B6 for ; Mon, 9 Nov 2015 17:08:09 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C0A17120481; Mon, 9 Nov 2015 17:08:08 +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 2E9DB120439 for ; Mon, 9 Nov 2015 17:08:04 +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=8Zy16g9RXcrzzfWfYEYzN7cO7fw=; b=NzkyQCa9ux7XqyWWcy +q69el21yJafpLkg6jIZqEYZ+eE1GjLzKtpEtWmFtEgtamHaysVs3EwpRrcfaAHK MXgUCk1JWTGDj/0qQIuN4zkxSioHPw4bgGUXhDadpNQENhAcBQcmzAvkI+ZjECy2 wT2OZXzw1s8h3A2E77PJhOHjU= Received: by filter-395.sjc1.sendgrid.net with SMTP id filter-395.31200.5640546012 2015-11-09 08:08:00.200577268 +0000 UTC Received: from herokuapp.com (ec2-54-145-97-147.compute-1.amazonaws.com [54.145.97.147]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id HbBckTRpTA-N49UV3SJ-TQ for ; Mon, 09 Nov 2015 08:08:00.578 +0000 (UTC) Date: Mon, 09 Nov 2015 08:08:00 +0000 From: ko1@atdot.net 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: 46049 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11653 X-Redmine-Issue-Author: danielpclark X-Redmine-Issue-Assignee: nobu X-Redmine-Sender: ko1 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4i9en15erUs+PoQzxkR8/a/Gt0HeS3meT6/i SEcvt6pxiDS73wrLveHQy9OJzvm6r7FVLUX4xvpxunqtT9tSd5BnrVi0xKUnEevWnj/jXnzaT/GOaa hJRXoOFKk+YGEzU= X-ML-Name: ruby-core X-Mail-Count: 71405 Subject: [ruby-core:71405] [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 Koichi Sasada. Discussion: https://docs.google.com/document/d/1D0Eo5N7NE_unIySOKG9lVj_eyXf66BQPM4PKp7NvMyQ/pub Feel free to continue discussion on this ticket. ---------------------------------------- Feature #11653: Add to_proc on Hash https://bugs.ruby-lang.org/issues/11653#change-54775 * Author: Daniel P. Clark * Status: Open * Priority: Normal * Assignee: Nobuyoshi Nakada ---------------------------------------- Procs can be called the same way a hash is with `[]`. But a Hash is not mappable as a Proc. ~~~ruby 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/