Forum: Ruby Thoughts on #require options

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
45196398e9685000d195ec626d477f0e?d=identicon&s=25 transfire (Guest)
on 2005-11-14 04:18
(Received via mailing list)
Matz mentioned a few days ago leaving additional #require parameters
open for potential future use. What is the general opinion on the
utility of having require options --pseudo code:

  module Kernel
    def requre( path, options=nil )
      previous = $require_options
      $require_options = options || {}
      Kernel.require( path )
      $require_options = previous
    end
  end

Besides specifying lib versions I have only thought of one addtional
use, turning on/off extraneous functionality --sort of akin to compile
options in C. I'm not so sure that it's a good idea.

T.
2dc2228d8db84b46bdd834b0515a26a1?d=identicon&s=25 lyndon.samson (Guest)
on 2005-11-14 04:36
(Received via mailing list)
How about passing an IO as the source of the loaded library?
This topic is locked and can not be replied to.