From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 220101F87F for ; Wed, 14 Nov 2018 14:47:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 863C9121635; Wed, 14 Nov 2018 23:47:00 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id B6339121633 for ; Wed, 14 Nov 2018 23:46:57 +0900 (JST) Received: by filter0002p3iad2.sendgrid.net with SMTP id filter0002p3iad2-703-5BEC3559-7 2018-11-14 14:46:49.13337449 +0000 UTC m=+3402.687672226 Received: from herokuapp.com (ec2-54-80-98-117.compute-1.amazonaws.com [54.80.98.117]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id -qg8DNdARHOtWjJ9UOcBYA Wed, 14 Nov 2018 14:46:48.881 +0000 (UTC) Date: Wed, 14 Nov 2018 14:46:49 +0000 (UTC) From: shevegen@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 65185 X-Redmine-Project: common-ruby X-Redmine-Issue-Id: 13581 X-Redmine-Issue-Author: americodls X-Redmine-Sender: shevegen 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7W/HJuXVQtd0w495BC5I2gg/3YO9sGLiOZg/ wWLMqpx9RgptrJlYn9axFNB/X79Ih+kuF4daAumWxtEZ8ITG/bIHx16r02AMc3cn/AN15kiZ/1amNz PCC37cpLvFy047TIrx8nJzne/YFyQOmiCQWI X-ML-Name: ruby-core X-Mail-Count: 89794 Subject: [ruby-core:89794] [CommonRuby Feature#13581] Syntax sugar for method reference 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13581 has been updated by shevegen (Robert A. Heiler). I think .: is better than ::: but it is not very pretty either. I have no better suggestion, though. Good syntax is not easy to use. :( I agree with the functionality by the way. ---------------------------------------- Feature #13581: Syntax sugar for method reference https://bugs.ruby-lang.org/issues/13581#change-74859 * Author: americodls (Americo Duarte) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Some another programming languages (even Java, in version 8) has a cool way to refer a method as a reference. I wrote some examples here: https://gist.github.com/americodls/20981b2864d166eee8d231904303f24b I miss this thing in ruby. I would thinking if is possible some like this: ~~~ roots = [1, 4, 9].map &Math.method(:sqrt) ~~~ Could be like this: ~~~ roots = [1, 4, 9].map Math->method ~~~ What do you guys thinking about it? -- https://bugs.ruby-lang.org/