On 19/02/2008, Gonzalo Garramuo <ggarra / advancedsl.com.ar> wrote:
> Martin Duerst wrote:
> > == Introducing require_relative
> > Proposal to add require_relative, require'ing a file relative to the
> > file where it is used.
> > -> accepted
> >
>
> Is this a good idea at all?  Often times, libraries need to be modified
> due to bugs or enhanced features.  By being able to change LOAD_PATH,
> this is trivial.  Any use of require_relative in a library module will
> screw that up completely and prevent files from being overridden.
>

You would have to copy (or symlink) the whole library then, not just a
single file.

However, not having a corresponding load feature makes this really unbalanced.

Also I would think of this as another tool for overriding single files
but I do not know how it would interact with normal require then.

Using this in a library that has multiple nested directories might
look convenient but it would turn the library into a monolith. You
cannot move any files around without unexpected consequences.

And again the semantics of mixing require_relative with require are
unclear. As they look up files differently it is no longer easy to
tell if certain file is supposed to be loaded on require or it is
already present.

Thanks

Michal