From: "mame (Yusuke Endoh) via ruby-core" Date: 2025-02-26T04:02:39+00:00 Subject: [ruby-core:121170] [Ruby master Misc#21154] Document or change Module#autoload? Issue #21154 has been updated by mame (Yusuke Endoh). > Why I don't show source code? Because this is not a ticket motivated by a need I have. I see, you really do not have a use case. I finally understand. I had misunderstood that you were hiding your use cases and somewhat challenging us. (I am not sure if my English wording is appropriate here, sorry if it makes a wrong sense.) Sorry for the frustration. Let me explain why I am eager to hear the use cases. In principle, all proposed changes to Ruby are considered based on the use cases that would require the change. Even if it is just an inconsistency, we force ourselves to assume use cases that could be affected by the inconsistency and then consider how (and whether) to fix it. Therefore, ticket discussions at the dev meetings begin with an understanding of the use case. Without a background explanation in the ticket, a great deal of time is spent to try identifying use cases. Still, it is impossible to cover all the use cases in a limited amount of time, so we could reach incomplete conclusions. We sometimes end up finding a different use case than the one the proposer has in mind, leading to a conclusion that the users, including the proposer, do not want. If a reasonable use case cannot be found, we need to ask the proposer to clarify, which takes time. Or we may choose WONTFIX, or make a random choice based on matz's intuition, which is also often not the result desired by the proposer. You may think that Ruby committers has the "answer" to the question you have and you want to just get it out of us. In fact, we have no "answer". At least I do not have. I believe matz does not have it either for your question yet. We need to decide how (and whether) to fix it by using the use cases. If there is no particular use case that is troubling you, then we tend to choose "don't touch it" or just rely on matz's intuition. As for autoload, there is a long history of subtle and repeated fine-tuning based on problems encountered in real-workd use cases. Therefore, I feel strong resistance to changing something based on intuition alone. I am afraid that by making a bad change, Zeitwerk stops working, which will affect many people. This is the reason why I insisted on asking you, the author of Zeitwerk, for background on this issue. ---------------------------------------- Misc #21154: Document or change Module#autoload? https://bugs.ruby-lang.org/issues/21154#change-112109 * Author: fxn (Xavier Noria) * Status: Open ---------------------------------------- The documentation of `Module#autoload?` says > Returns filename to be loaded if name is registered as autoload in the namespace of mod or one of its ancestors. Cool, but in the following snippet ```ruby autoload :Foo, 'foo' autoload?(:Foo) ``` the second line could evaluate to `nil`, and this does not seem to agree. I just registered an autoload, therefore (according to the documentation) I should get "foo" back in line 2. I'd like to ask for clarification from the Ruby team: 1. Is the documentation complete? Should that second line always return "foo"? 2. If the answer is no, which is the logic missing in the docs? Thank you! -- 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/lists/ruby-core.ml.ruby-lang.org/