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=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham 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 93F561F609 for ; Fri, 24 May 2019 00:52:34 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B5D51120ACE; Fri, 24 May 2019 09:52:29 +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 039251208FF for ; Fri, 24 May 2019 09:52:26 +0900 (JST) Received: by filter0091p3mdw1.sendgrid.net with SMTP id filter0091p3mdw1-15086-5CE7404C-19 2019-05-24 00:52:28.513733664 +0000 UTC m=+28213.196918435 Received: from herokuapp.com (unknown [184.73.130.48]) by ismtpd0022p1iad2.sendgrid.net (SG) with ESMTP id nbwIGQ-ZT426DSQM_sClWA for ; Fri, 24 May 2019 00:52:28.542 +0000 (UTC) Date: Fri, 24 May 2019 00:52:28 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68294 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15842 X-Redmine-Issue-Author: jeremyevans0 X-Redmine-Sender: jeremyevans0 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: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BIpO1d5UmkvGl9a0=2F1YKPb7mnwjNHuGDS6yq306?= =?us-ascii?Q?wiXjsgyGL05DM3rfvHpdydBWiU3zGXso4rNfagG?= =?us-ascii?Q?YTIQXQxYZSIQp9gaGZL5plsRH8fc0r=2FBBtomkXt?= =?us-ascii?Q?cVXvWsAdOqCY5nDHrf3ZOttLx34erGH5LEQ=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92810 Subject: [ruby-core:92810] [Ruby trunk Feature#15842] Allow DelegateClass() to module_eval given block 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 #15842 has been updated by jeremyevans0 (Jeremy Evans). As delegate.rb is unmaintained, unless someone objects in the next week, I plan on committing this feature. ---------------------------------------- Feature #15842: Allow DelegateClass() to module_eval given block https://bugs.ruby-lang.org/issues/15842#change-78182 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Methods that return classes often module_eval the given block (e.g. `Class.new` and `Struct.new`). This allows `DelegateClass` to work similarly. This makes it easier to use `DelegateClass` directly without subclassing, so as not to create an unnecessary intermediate class. Example: ```ruby MyClass = DelegateClass(ClassToDelegateTo) do def initialize super(obj_of_ClassToDelegateTo) end end ``` Attached is a patch that implements this proposal. ---Files-------------------------------- delegate-class-block.patch (2.26 KB) -- https://bugs.ruby-lang.org/