From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 83E951F542 for ; Tue, 6 Jun 2023 12:00:39 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=PXmIN/Dr; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=gpdM7k+z; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id E485E7F855; Tue, 6 Jun 2023 12:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1686052829; bh=feuUVIvdnsfhvxuA68t5Um91gwAraTD5enDFyfx1OPw=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=PXmIN/DrZS6DLtryAkGneESVTXACAIGTHqeROQz5fxhhMwc4phUoGHV/amRKn+4Ry XHNiX5f3KXqnK1mwzx9UFYOH509aEsIhd9FBJiYYunyFE7qaPXs98iIjKxWnK486oB d8kQO67lp+yLqgDv9PGEjWuhdIuvmxM054nN5K2s= Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id C88FD7F7FA for ; Tue, 6 Jun 2023 12:00:24 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=gpdM7k+z; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=/nPJ6VVzz2e6VBxv6petGULssKD6ra2SV5u8o/nFpls=; b=gpdM7k+znuJ90i0vxnGeUQxPunbFmjI/9z9YacWplkoKE1yLv1NfScONR5tYwcJN5sXj c0OOc8oj9iV1mLIYRJy7TRwp09jYNBb3+SE09byC8U0uu/34Xei0JovkT8mS/3CcK/ibjs F6cQ9OaGPBFoXN4kb4RBHcUHH8aM3tlvPrpA7+wQSl0zwf0G2xc/wnJDF40/emDlLG7EIi KDtsoqRQiSaRTziMGH1KnM0ukp0ZtPj5eF6vcvzji15n+OZ5eKPVVGirfgEmxWuBELMTuO kPmY10zBo9a3wbadJm3dIMGIvrRidYGdnc4t1Ix2IE8SIpRklRROfg3phfic6O8Q== Received: by filterdrecv-77869f68cc-qgx7h with SMTP id filterdrecv-77869f68cc-qgx7h-1-647F1FD6-F9 2023-06-06 12:00:22.575090202 +0000 UTC m=+2291050.757337329 Received: from herokuapp.com (unknown) by geopod-ismtpd-22 (SG) with ESMTP id 4RF1W3J5Q6isMGIj_VgYbQ for ; Tue, 06 Jun 2023 12:00:22.508 +0000 (UTC) Date: Tue, 06 Jun 2023 12:00:22 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 12737 X-Redmine-Issue-Author: shugo X-Redmine-Issue-Assignee: shugo X-Redmine-Sender: Eregon 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-Redmine-MailingListIntegration-Message-Ids: 90244 X-SG-EID: =?us-ascii?Q?DvL3W2Xo+Vk=2FeUn3F50L=2FNc8u9NqZCnbE0mXZHiyye4R1YZg=2FtAFc0SAFzpcS=2F?= =?us-ascii?Q?Zcr7BqPN=2FYCcMZBMITNeIci9STxYay0JAJWPbek?= =?us-ascii?Q?rFR+qXMsjjvKfvZbRXgT=2F14+H36KGs7evtoNP1u?= =?us-ascii?Q?32JjcOAYHhyHfHGixheSwv4FiBheNko5iGeo1By?= =?us-ascii?Q?hNOii4ZNxmCGLVl6JA3mcJHWrN1xOnrJO3dY0It?= =?us-ascii?Q?F7tJiEdlF2oTYNoQrynwHXIIaFDty+PBRu3WGIi?= =?us-ascii?Q?1Lvcznv7IyQQ79Kv7+e+w=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: BYNJQA2ZQ2UFQDO6GBRUDVU3APZ3KBZS X-Message-ID-Hash: BYNJQA2ZQ2UFQDO6GBRUDVU3APZ3KBZS X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:113777] [Ruby master Feature#12737] Module#defined_refinements List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #12737 has been updated by Eregon (Benoit Daloze). `Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity? ---------------------------------------- Feature #12737: Module#defined_refinements https://bugs.ruby-lang.org/issues/12737#change-103426 * Author: shugo (Shugo Maeda) * Status: Closed * Priority: Normal * Assignee: shugo (Shugo Maeda) ---------------------------------------- How about to provide Module#defined_refinements, which returns the refinements defined in the receiver as a Hash, as follows: ``` module M refine String do $M_String = self end refine Integer do $M_Integer = self end end p M.defined_refinements #=> {String => $M_String, Integer => $M_Integer} ``` By `Module#defined_refinements`, you can activate refinements globally: ``` for klass, refinement in M.defined_refinements klass.prepend(refinement) end ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/