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 [IPv6:2a01:4f8:1c0c:6b10::1]) (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 081861F542 for ; Tue, 6 Jun 2023 12:37:43 +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=I+JNkMHt; 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=uJUZu/VE; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 3FD297F859; Tue, 6 Jun 2023 12:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1686055054; bh=96vKgTWSZKHtHB+WWT3Cn0Ged9aMOvXVJU7+ODVaXzs=; 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=I+JNkMHtqgBueKyO7h/S8XE9TQCp8YP3szHIpSRolIs8uDG2WDBX+zlQGsnwxea/t vgIwvqUS099rX1w8bQ2O1pObJGKtfcdakV31ZRVG1nDKLr2IvywFzngfFqB3t6lD50 unnnirFM+tE52Qg22WYmEYVCNeE1tII3N8gz/Fj8= Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 996047F856 for ; Tue, 6 Jun 2023 12:37:30 +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=uJUZu/VE; 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=MLLClArdBtHI+AxNx4KmIuLN3pzQ+tag+6Uk9b/lyJ4=; b=uJUZu/VEbOS5QReELxGuMpYNjHtjO+eYq6cy7nF9It1+nW5io3u3BKLbwP4pmRK1Gfxm qd6fqcEfnalRwyvGuS7SgxV1KSNA0dLnEXs4Tk7+GaeC4hfq2ikxZlPOKCWUKPuHcnadgf cKvwKVxnx1QQfm1iH+HwDdropoMW761Yw4vDqrDBawIIIooF1A+KqAw+ac5P6fzR8FQARA Aeb0SgJmq8JoRIHgrfJAZgZNFyw77hX+0VJh2zezdA1fCecAx2xiNIVA1Gwu/hdOqOstI8 4S3bmegXiiT4vAZThFcPzOWm6g3HgYkSTPh19cC1jlvxRKpDikXC+rMhE1rbIYeA== Received: by filterdrecv-66949dbc98-vthls with SMTP id filterdrecv-66949dbc98-vthls-1-647F2888-19 2023-06-06 12:37:28.460298522 +0000 UTC m=+2293067.200697389 Received: from herokuapp.com (unknown) by geopod-ismtpd-14 (SG) with ESMTP id fYr4WGy5Sp62F-RxS8F8Qg for ; Tue, 06 Jun 2023 12:37:28.408 +0000 (UTC) Date: Tue, 06 Jun 2023 12:37:28 +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: shugo 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: 90245 X-SG-EID: =?us-ascii?Q?o0C=2FsDUd4ZFGiDZCTbvVjqibxcpCfydz4lwnBQWyXZ+Plw=2FfhrG0CQPbrktOPX?= =?us-ascii?Q?NfKIrb7bilCwkXET66DNxoL1okTUPLDj+W+XVKr?= =?us-ascii?Q?yuztc78hCTus5KJVwIDTm9DLHEWryuLdk7Ejwg9?= =?us-ascii?Q?oRmVP6PrGVuClxd9s7radWq1rdSfTBsTZlkpups?= =?us-ascii?Q?B5d4689Gbyz3uIYRpAr37ZDnz1HTs7RFH1bf1xx?= =?us-ascii?Q?walwZ4ogJTQdVayH9E4FmVOtde1dw=2FN0oe6UGCH?= =?us-ascii?Q?tfhxQgBrUHlWic97=2FCABw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: AG7W4OPYNYPT2YC55UGHKDUBX7QUO55A X-Message-ID-Hash: AG7W4OPYNYPT2YC55UGHKDUBX7QUO55A 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:113778] [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: "shugo (Shugo Maeda) via ruby-core" Cc: "shugo (Shugo Maeda)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #12737 has been updated by shugo (Shugo Maeda). Eregon (Benoit Daloze) wrote in #note-15: > `Refinement#refined_class` is a bit strange given it can return a module. > How about adding `Refinement#refined_module` as an alias for clarity? I'm for it, but it may be better to create another issue. ---------------------------------------- Feature #12737: Module#defined_refinements https://bugs.ruby-lang.org/issues/12737#change-103427 * 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/