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 0A53617DF1BF for ; Mon, 20 Apr 2015 05:27:16 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id C1162B5D8CE for ; Mon, 20 Apr 2015 05:39:04 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 4A2E597A827 for ; Mon, 20 Apr 2015 05:39:05 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Khn2b7oKQW9A for ; Mon, 20 Apr 2015 05:39:05 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 2674297A820 for ; Mon, 20 Apr 2015 05:39:05 +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 A62C8952439 for ; Mon, 20 Apr 2015 05:39:04 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C254C120487; Mon, 20 Apr 2015 05:39:03 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 62FB6120476 for ; Mon, 20 Apr 2015 05:38:59 +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=xGPuJnl+U50NLzkwVvxnTDJZzGQ=; b=LNlKUabFEO41mxZIhJ qvCG3tap4hIDsgW5mY+A+rJBE4KZuznRwjt4Ym13SwNv4l0knMAcQt3lyIzF15K8 9Iht0nnZYE5y6bekCV3/iCM4AuZyn9Kob2KerETXkKPwKFbfKMwRjdY/LS2Cvj42 CRarERnguC35KIUBoEsUWIJ/4= Received: by filter0087p1mdw1.sendgrid.net with SMTP id filter0087p1mdw1.29583.5534125F6 2015-04-19 20:38:55.697105313 +0000 UTC Received: from herokuapp.com (ec2-54-146-151-239.compute-1.amazonaws.com [54.146.151.239]) by ismtpd-033 (SG) with ESMTP id 14cd367c5dd.4cfe.223be7 for ; Sun, 19 Apr 2015 20:38:55 +0000 (UTC) Date: Sun, 19 Apr 2015 20:38:55 +0000 From: bottiger@live.com 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: 43332 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11076 X-Redmine-Issue-Author: haraldb X-Redmine-Sender: haraldb X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: OOF Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7wSVYC3goOSQ1MSCFK2o+A18HvbQe1H59fCt FaJVRRIgjdJiJi6aoS68TCJBX2bm3KUXsKS57A1BpRATEYsoDUiyg3WRLknmmTT+PAwEV4HPyqnJbl fJSQCbmDceWlDhy0SbC1FY4NUyVjJ/smVg+p X-ML-Name: ruby-core X-Mail-Count: 68932 Subject: [ruby-core:68932] [Ruby trunk - Feature #11076] [Open] Enumerable method count_by 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 #11076 has been reported by Harald B=C3=B6ttiger. ---------------------------------------- Feature #11076: Enumerable method count_by https://bugs.ruby-lang.org/issues/11076 * Author: Harald B=C3=B6ttiger * Status: Open * Priority: Low * Assignee:=20 ---------------------------------------- I very often use `Hash[array.group_by{|x|x}.map{|x,y|[x,y.size]}]`. Would be nice with to have a method called `count_by`: array =3D ['aa', 'aA', 'bb', 'cc'] p array.count_by(&:downcase) #=3D> {'aa'=3D>2,'bb'=3D>1,'cc'=3D>1} --=20 https://bugs.ruby-lang.org/