
Issue #19682 has been updated by bughit (bug hit). In general I would add that there are other implicit contexts in ruby that are not obvious or intuitable in various meta-programming scenarios. They are "default definee" (method definition), constant definition (cref I think) and class variable (`@@`) definition. I don't think their metaprogramming behavior is well documented, so there's good reason for ruby to help with identifying them explicitly. "default definee" starts lexical but can be shifted dynamically (class_eval, instance_eval, ...). Constant definition might be fully lexical and @@ I don't remember anything about from some experimentation long ago. I didn't include ivar definition as I believe that's the simplest and best understood context, fully dynamic, relative to self, AFAIK. But the point here is, there's variance among the implicit contexts and hybrid (lexcial/dynamic) behavior is possible for some, so collectively its not trivial to keep this all in your head on instant recall, there's definitely opportunity for forgetting/confusing. ---------------------------------------- Feature #19682: ability to get a reference to the "default definee" https://bugs.ruby-lang.org/issues/19682#change-103235 * Author: bughit (bug hit) * Status: Open * Priority: Normal ---------------------------------------- https://blog.yugui.jp/entry/846 "default definee" is a pretty important context so why not make it easy to identify? Could be a Module class method or a global method (Kernel) or a keyword. -- https://bugs.ruby-lang.org/