From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 341231F5A0 for ; Fri, 10 Feb 2023 00:49:03 +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=W7cBZK+6; 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=fJTs5ykf; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 886C27F1B6; Fri, 10 Feb 2023 00:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1675990135; bh=/HR8lG39JEM8IU2DUI/Y+eoJtf9Nr68O831do+STfw8=; 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=W7cBZK+60IK94Sqy0BZLw5ewcCOGwPIdaGKPO32gFxcxJ+E52odwJKnUBNtuzKEBI e8cv/pglofNsZrzCRgmIbVHQTJedEqsyCDTzU4wii3ZcVEB4WeweGmZAYtr1HR96yU +AAcr9s9peGPEmbMadiBYvxSX9Rtphz84kcMx07Y= Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 27B187F1AD for ; Fri, 10 Feb 2023 00:48:51 +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=fJTs5ykf; 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=t8tiaUeHXin8gozzAU9VJeTuuVQu/32/N+PwNHF/vsQ=; b=fJTs5ykfqlC5W7T+S5LJHzF/FFOZSbAsqC/3uevBfRsGwa9QA88pAgzeAuvMXb5VqiAh uwUXRYxmnE/tivl1ZkpHr8dEpUE8II/JC0HOTxe3Wd039xj6eC2FjEdvu4+v63bQ1en3Os sjO0NkckBIqiNVYj4VxBFR8Y08FMWoamQL/7mNwQSDNhT1Xv887qr8uon6h0Uh/5C3u4Qw VTiLLTEJYDlM8cB7QeLjTW6hnQXzI17aSRs5vWFK46jGsleVjQjUIETKfzUZEPwPUZid81 XK/MTfMQZnnhzZal8BgpTK+95u0W/easp3Ag3AAZLV5seTtRTW8Hm975xsS6SHrw== Received: by filterdrecv-8569859b9-t5l9k with SMTP id filterdrecv-8569859b9-t5l9k-1-63E59471-2B 2023-02-10 00:48:49.926442545 +0000 UTC m=+4722504.455115283 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-1 (SG) with ESMTP id GLTk7uMHTNa_leGU6mRGRQ for ; Fri, 10 Feb 2023 00:48:49.853 +0000 (UTC) Date: Fri, 10 Feb 2023 00:48:49 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17753 X-Redmine-Issue-Author: tenderlovemaking X-Redmine-Sender: shioyama 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: 88704 X-SG-EID: =?us-ascii?Q?2eXjFJg7SJ5y3z7=2FYZLzXiX0MH8ZxaRPe+ZjMibzxKHc16mJTtFOJX09zPdTSg?= =?us-ascii?Q?i7RAdHtyRFyjpk4L96iTT9m5Mpw0LXz5lR9wlty?= =?us-ascii?Q?qBqkXkbGW=2F9g0pyk4CyeA7Rj2T7XSWqfQc04SCW?= =?us-ascii?Q?quW6sv8cZKK7y17MWsm+PyDjG66vr1VbNCmf3eH?= =?us-ascii?Q?6CgH=2FNK+MWt8pbHYpxrl3aZs4f1CEWxzqfQQCpU?= =?us-ascii?Q?yQPAIfBMgpkn5hQ+ZTArmO2v4U7fPkC0kd07eQI?= =?us-ascii?Q?jyzQGo+oFTKJAJEzGj6Lw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: 7O2T6NGM7HKGBN77JB7GGX2PAU42ILXJ X-Message-ID-Hash: 7O2T6NGM7HKGBN77JB7GGX2PAU42ILXJ 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:112316] [Ruby master Feature#17753] Add Module#namespace List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "shioyama (Chris Salzberg) via ruby-core" Cc: "shioyama (Chris Salzberg)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #17753 has been updated by shioyama (Chris Salzberg). > Regarding your proposal, in English would be `parent_module` right? My interpretation here, but to me "parent module" would signify the "parent thing that is a module" of the current thing (whatever that thing may be), whereas "module parent" would signify the "module's parent", implying the _parent_ could be anything (but kind of implying it is also a module). English-wise as a method name either is possible, they just have slightly different emphasis. I suggested `module_parent` because it exists and is being used for the same thing, so there's a precedent, which might make it easier to agree on. ---------------------------------------- Feature #17753: Add Module#namespace https://bugs.ruby-lang.org/issues/17753#change-101757 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal ---------------------------------------- Given code like this: ```ruby module A module B class C; end class D; end end end ``` We can get from `C` to `B` like `C.outer_scope`, or to `A` like `C.outer_scope.outer_scope`. I want to use this in cases where I don't know the outer scope, but I want to find constants that are "siblings" of a constant. For example, I can do `A::B::C.outer_scope.constants` to find the list of "sibling" constants to `C`. I want to use this feature when walking objects and introspecting. For example: ```ruby ObjectSpace.each_object(Class) do |k| p siblings: k.outer_scope.constants end ``` I've attached a patch that implements this feature, and there is a pull request on GitHub [here](https://github.com/ruby/ruby/pull/4326). ---Files-------------------------------- 0001-Add-Module-outer_scope.patch (5.93 KB) 0001-Add-Module-namespace.patch (5.89 KB) -- 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/