------art_112_2936395.1322201455614
Content-Type: multipart/alternative; 
	boundary---art_113_26984676.1322201455615"

------art_113_26984676.1322201455615
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

"autoloading" can still be done by putting the require within a method that 
is called only as needed.

The downside of this is that requires get pushed down into deeper levels of 
code, making requirements less obvious to developers. Documentation not 
withstanding, it's also not hard to work around. Just link us something 
like:

    $AUTOREQ  ash.new{|h,k|h[k]}

    def req(key, path)
      $AUTOREQ[key.to_sym] << path
    end

    def use(key)
      $AUTOREQ[key.to_sym].each{ |path| require path }
    end

Then

    req :rdoc, 'rdoc'
    req :markdown, 'redcarpet'

    class Tmpl
      initialize(type)
        use type

I'm sure this can be greatly improved upon, maybe even generalized (and 
thread safe?) to make a useful library gem.


------art_113_26984676.1322201455615
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

"autoloading" can still be done by putting the require within a method thats called only as needed.<div><br></div><div>The downside of this is that requires get pushed down into deeper levels of code, making requirements less obvious to developers. Documentation not withstanding, it's also not hard to work around. Just link us something like:</div><div><br></div><div>&nbsp; &nbsp; $AUTOREQ = Hash.new{|h,k|h[k]=[]}</div><div><br></div><div>&nbsp; &nbsp; def req(key, path)</div><div>&nbsp; &nbsp; &nbsp; $AUTOREQ[key.to_sym] &lt;&lt; path</div><div>&nbsp; &nbsp; end</div><div><br></div><div>&nbsp; &nbsp; def use(key)</div><div>&nbsp; &nbsp; &nbsp;&nbsp;$AUTOREQ[key.to_sym].each{ |path| require path }</div><div>&nbsp; &nbsp; end</div><div><br></div><div>Then</div><div><br></div><div>&nbsp; &nbsp; req :rdoc, 'rdoc'</div><div>&nbsp; &nbsp; req :markdown, 'redcarpet'<br></div><div><br></div><div>&nbsp; &nbsp; class Tmpl</div><div>&nbsp; &nbsp; &nbsp; initialize(type)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; use type</div><div><br></div><div>I'm sure this can be greatly improved upon, maybe even generalized (and thread safe?) to make a useful library gem.</div><div><br></div>
------art_113_26984676.1322201455615--

------art_112_2936395.1322201455614--