
Issue #19644 has been updated by bughit (bug hit). ioquatix (Samuel Williams) wrote:
In some cases, where things like `Module.nesting[n]` is too slow, having an argument like `Module.nesting(n)` or such which gets the first `n`
`Module.nesting(n)` does address the perf aspect, but it makes rather too verbose and obfuscated/ugly to get the current: `Module.nesting(1)[0]`. It ought to be more compact, perhaps just `__module__` like `__method__` ---------------------------------------- Feature #19644: Module::current to complement Module::nesting https://bugs.ruby-lang.org/issues/19644#change-103210 * Author: bughit (bug hit) * Status: Rejected * Priority: Normal ---------------------------------------- Module::current == Module::nesting[0] but without needlessly walking the entire nesting hierarchy. Could be useful for debugging/logging. It could also be a Kernel global (like `__method__`) or a keyword (like `__FILE__`) -- https://bugs.ruby-lang.org/