[ruby-core:105868] [Ruby master Feature#11919] Passing a module directly
From:
"Dan0042 (Daniel DeLorme)" <noreply@...>
Date:
2021-10-29 16:08:42 UTC
List:
ruby-core #105868
Issue #11919 has been updated by Dan0042 (Daniel DeLorme). jeremyevans0 (Jeremy Evans) wrote in #note-12: > @matz pretty much rejected `using do` as well (https://bugs.ruby-lang.org/issues/14344#note-15): `the modified syntax using do is also confusing`. So that's why I closed this (this feature is for `using do`). Ah yes, I don't see how I missed that. > Not sure where you are seeing pre-approval by @matz in #16241. I guess "pre-approval" was the wrong word. I meant it as "preliminary" or tentative endorsement, not as "it's already approved". ---------------------------------------- Feature #11919: Passing a module directly https://bugs.ruby-lang.org/issues/11919#change-94406 * Author: sawa (Tsuyoshi Sawada) * Status: Rejected * Priority: Normal ---------------------------------------- Refinement requires a named module: ~~~ruby module MyRefinement refine ... ... end using MyRefinement ~~~ but often (but not always), refinements are called by the `using` command only in once in a single file, and should not need to be named in such case. Also, the purpose of refinement is to not pollute classes with methods. Necessity to define a module and polluting the name space looks to me to go against this idea. I would like to do: ~~~ruby using Module.new do refine ... ... end ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>