ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:105664] [Ruby master Feature#6210] load should provide a way to specify the top-level module
       [not found] <redmine.issue-6210.20120328025746.935@ruby-lang.org>
@ 2021-10-18 18:32 ` jeremyevans0 (Jeremy Evans)
  2021-11-10 13:00 ` [ruby-core:106013] " byroot (Jean Boussier)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: jeremyevans0 (Jeremy Evans) @ 2021-10-18 18:32 UTC (permalink / raw)
  To: ruby-core

Issue #6210 has been updated by jeremyevans0 (Jeremy Evans).


I think this is a useful feature, and it can be implemented without any API changes/backwards compatibility issues.  I submitted a pull request for it: https://github.com/ruby/ruby/pull/4986

----------------------------------------
Feature #6210: load should provide a way to specify the top-level module
https://bugs.ruby-lang.org/issues/6210#change-94164

* Author: now (Nikolai Weibull)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
load currently takes an optional second argument that allows you to load into an anonymous and new top-level Module.  It would be nice if the second argument could also be a Module that would then be used as the top-level Module.  That way one could provide a set of methods that should be available to the content being loaded without having to put them in Kernel.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:106013] [Ruby master Feature#6210] load should provide a way to specify the top-level module
       [not found] <redmine.issue-6210.20120328025746.935@ruby-lang.org>
  2021-10-18 18:32 ` [ruby-core:105664] [Ruby master Feature#6210] load should provide a way to specify the top-level module jeremyevans0 (Jeremy Evans)
@ 2021-11-10 13:00 ` byroot (Jean Boussier)
  2021-11-18  6:23 ` [ruby-core:106119] " matz (Yukihiro Matsumoto)
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: byroot (Jean Boussier) @ 2021-11-10 13:00 UTC (permalink / raw)
  To: ruby-core

Issue #6210 has been updated by byroot (Jean Boussier).


Agreed, it could be used to experiment with new ways to load code in a non global manner.

That being said it would entirely sidestep iseq caching. Not that it's a deal breaker, but if this were to be used for loading lots of code, we might also need `RubyVM::InstructionSequence#eval(wrapping_module)` 

----------------------------------------
Feature #6210: load should provide a way to specify the top-level module
https://bugs.ruby-lang.org/issues/6210#change-94566

* Author: now (Nikolai Weibull)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
load currently takes an optional second argument that allows you to load into an anonymous and new top-level Module.  It would be nice if the second argument could also be a Module that would then be used as the top-level Module.  That way one could provide a set of methods that should be available to the content being loaded without having to put them in Kernel.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:106119] [Ruby master Feature#6210] load should provide a way to specify the top-level module
       [not found] <redmine.issue-6210.20120328025746.935@ruby-lang.org>
  2021-10-18 18:32 ` [ruby-core:105664] [Ruby master Feature#6210] load should provide a way to specify the top-level module jeremyevans0 (Jeremy Evans)
  2021-11-10 13:00 ` [ruby-core:106013] " byroot (Jean Boussier)
@ 2021-11-18  6:23 ` matz (Yukihiro Matsumoto)
  2021-11-18  8:46 ` [ruby-core:106125] " byroot (Jean Boussier)
  2021-11-18 17:59 ` [ruby-core:106154] " jeremyevans0 (Jeremy Evans)
  4 siblings, 0 replies; 5+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2021-11-18  6:23 UTC (permalink / raw)
  To: ruby-core

Issue #6210 has been updated by matz (Yukihiro Matsumoto).


OK, I (finally) accepted the proposal. Go ahead.

Matz.


----------------------------------------
Feature #6210: load should provide a way to specify the top-level module
https://bugs.ruby-lang.org/issues/6210#change-94716

* Author: now (Nikolai Weibull)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
load currently takes an optional second argument that allows you to load into an anonymous and new top-level Module.  It would be nice if the second argument could also be a Module that would then be used as the top-level Module.  That way one could provide a set of methods that should be available to the content being loaded without having to put them in Kernel.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:106125] [Ruby master Feature#6210] load should provide a way to specify the top-level module
       [not found] <redmine.issue-6210.20120328025746.935@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2021-11-18  6:23 ` [ruby-core:106119] " matz (Yukihiro Matsumoto)
@ 2021-11-18  8:46 ` byroot (Jean Boussier)
  2021-11-18 17:59 ` [ruby-core:106154] " jeremyevans0 (Jeremy Evans)
  4 siblings, 0 replies; 5+ messages in thread
From: byroot (Jean Boussier) @ 2021-11-18  8:46 UTC (permalink / raw)
  To: ruby-core

Issue #6210 has been updated by byroot (Jean Boussier).


What about the `RubyVM::InstructionSequence` was there any discussion to allow caching `Kernel.load(path, module_instance)`?

----------------------------------------
Feature #6210: load should provide a way to specify the top-level module
https://bugs.ruby-lang.org/issues/6210#change-94723

* Author: now (Nikolai Weibull)
* Status: Closed
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
load currently takes an optional second argument that allows you to load into an anonymous and new top-level Module.  It would be nice if the second argument could also be a Module that would then be used as the top-level Module.  That way one could provide a set of methods that should be available to the content being loaded without having to put them in Kernel.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:106154] [Ruby master Feature#6210] load should provide a way to specify the top-level module
       [not found] <redmine.issue-6210.20120328025746.935@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2021-11-18  8:46 ` [ruby-core:106125] " byroot (Jean Boussier)
@ 2021-11-18 17:59 ` jeremyevans0 (Jeremy Evans)
  4 siblings, 0 replies; 5+ messages in thread
From: jeremyevans0 (Jeremy Evans) @ 2021-11-18 17:59 UTC (permalink / raw)
  To: ruby-core

Issue #6210 has been updated by jeremyevans0 (Jeremy Evans).


byroot (Jean Boussier) wrote in #note-9:
> What about the `RubyVM::InstructionSequence` was there any discussion to allow caching `Kernel.load(path, module_instance)`?

The dev meeting log does not indicate this was discussed.  If you think it's important, can you add it as a new feature request?

----------------------------------------
Feature #6210: load should provide a way to specify the top-level module
https://bugs.ruby-lang.org/issues/6210#change-94755

* Author: now (Nikolai Weibull)
* Status: Closed
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
load currently takes an optional second argument that allows you to load into an anonymous and new top-level Module.  It would be nice if the second argument could also be a Module that would then be used as the top-level Module.  That way one could provide a set of methods that should be available to the content being loaded without having to put them in Kernel.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-18 17:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-6210.20120328025746.935@ruby-lang.org>
2021-10-18 18:32 ` [ruby-core:105664] [Ruby master Feature#6210] load should provide a way to specify the top-level module jeremyevans0 (Jeremy Evans)
2021-11-10 13:00 ` [ruby-core:106013] " byroot (Jean Boussier)
2021-11-18  6:23 ` [ruby-core:106119] " matz (Yukihiro Matsumoto)
2021-11-18  8:46 ` [ruby-core:106125] " byroot (Jean Boussier)
2021-11-18 17:59 ` [ruby-core:106154] " jeremyevans0 (Jeremy Evans)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).