From: Eric Hodel Date: 2011-01-11T07:39:46+09:00 Subject: [ruby-core:34316] Re: Avoiding $LOAD_PATH pollution On Jan 9, 2011, at 23:33, Charles Oliver Nutter wrote: > The base protocol seems fine to me. I think you and I discussed it on > IRC at some point. I like its simplicity. > > I do have a concern for the additional overhead it adds to all > requires. case/when matching does a dispatch to ===, so that's a > dyncall for every element at the very least. Probably could be > short-circuited in the C code. In C code I would only dispatch if a path element wasn't a T_STRING object > The loaded? implementation is broken like gem_prelude on systems with > case-insensitive filesystems like OS X and Windows. JRuby just added a > change to "require" that the $" search is done case-insensitively when > on a case-insensitive filesystem, but it's an experimental change. We > made it originally to work around problems in gem_prelude that > disappeared when we wiped out gem_prelude� For a real #loaded? implementation I would prefer using the built-in C functionality in rb_require. > The specified protocol would also greatly simplify logic in JRuby to > load files from URLs and classloader resources. Where currently we > have special-cased logic to search those types of artifacts, with your > change we'd simply register "finders" in the load path that can handle > them. > > This probably could also tie into the Ruby Archive RSoC project, > allowing MRI to also load code from archives. I did not follow that > project closely enough to know its status. Yes, I was thinking about this use-case.