load should provide a way to specify the top-level module
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.
Updated by byroot (Jean Boussier) almost 2 years ago
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
Updated by jeremyevans (Jeremy Evans) almost 2 years ago
- Status changed from Assigned to Closed
Updated by jeremyevans0 (Jeremy Evans) almost 2 years ago
byroot (Jean Boussier) wrote in #note-9:
What about the
RubyVM::InstructionSequencewas there any discussion to allow caching
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?