From: "bughit (bug hit) via ruby-core" Date: 2023-05-20T18:05:55+00:00 Subject: [ruby-core:113563] [Ruby master Feature#19682] ability to get a reference to the "default definee" Issue #19682 has been updated by bughit (bug hit). > @bughit This is a bit insulting, I know how Ruby work, I implemented all these concepts in TruffleRuby. > The point is these things are things Ruby needs to track internally, but the user probably has no need for. Not clear to me how you can implement these concepts and still be confused about the differences among self, Module::nesting[0] and "default definee". Are you sure you did it correctly? I've never used TruffleRuby but now I'm afraid to. Let's take your latest pearl ("are things Ruby needs to track internally, but the user probably has no need for"), it evinces more confusion. When a user uses def in various metaprogramming contexts, where that method ends up, depends on the current "default definee". And what it is, is not necessarily always obvious. The various rules for how the "default definee" shifts, both lexically and dynamically are in the blog linked in the OP. I wouldn't call them intuitable, you need to understand and remember them. So with that, why don't you try to answer again, does it matter to the user what class their method definitions are applied to? Or does it matter only to Ruby? ---------------------------------------- Feature #19682: ability to get a reference to the "default definee" https://bugs.ruby-lang.org/issues/19682#change-103196 * 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/ ______________________________________________ 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/