From: "bughit (bug hit) via ruby-core" Date: 2023-05-25T00:37:02+00:00 Subject: [ruby-core:113649] [Ruby master Feature#19682] ability to get a reference to the "default definee" Issue #19682 has been updated by bughit (bug hit). rubyFeedback (robert heiler) wrote in #note-22: > The question here is how a ruby user refers to it. What to name it is of secondary importance. This issue is about exposing it, I did not even suggest a name. For the purpose of discussion I am referring to it as "default definee" because that blog article is the only place I am aware of that documented the concept. If it's documented and named better elsewhere, great, let's see it. Until exposing it is settled on in principle, its pointless to argue about naming. > This presupposes that we SHOULD expose it, and I am not entirely certain Since it very much matters to the user where their methods end up, it should be possible for them to easily discover this context. This helps ruby be self documenting and helps the user learn the language. Any argument against it, unavoidably becomes at its core: lets keep ruby difficult to understand and learn. Any insinuation of the kind that, its a difficult concept that should be swept under the rug, is preposterous. The concept exists in ruby and affects user code, whether one likes it or not. You can chose to ignore it and stick to only simple and clear uses of `def`, but that shouldn't preclude others from understanding (with the help from ruby) the more complex ones. And exposing helps with that. > I understand that part of your argument is that it is not easy to see where self is right now "default definee" is not self, its also not the currently open module (Module.nesting[0]). Its more tricky. The fact that this is far from obvious to many/most, is the very justification for exposing it. It looks like no one who responded here (excluding matz), understands it fully, and yet are convinced that no assistance from ruby is justified. Let's go through the list: * Eregon * thinks its Module.nesting[0] * thinks the user doesn't need to think about it, its just for Ruby to worry about * ioquatix * appears to be conflating it with Module.nesting[0]: "I'll consider opening a new one with a specific proposal around Module#nesting(n)" * austin * "I���ve been using Ruby for 21 years and done lots of metaprogramming and ��� I have absolutely no clue what you���re talking about in this ticket." * rubyFeedback * conflating it with self Without realizing it you have all made my case. ---------------------------------------- Feature #19682: ability to get a reference to the "default definee" https://bugs.ruby-lang.org/issues/19682#change-103292 * Author: bughit (bug hit) * Status: Rejected * 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/