[racket-dev] Should `dynamic-require`d libraries be in package dependencies?

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Nov 26 15:21:51 EST 2013

Earlier today, Asumu Takikawa wrote:
> Hi all,
> 
> Should dynamically required libraries induce a package dependency?
> 
> Take for example the "xrepl-lib" package. It currently depends on
> five other packages, but I think two of them can be dropped and
> `raco setup` won't complain.
> 
> On the other hand, XREPL may `dynamic-require` the macro stepper
> (one of the dependencies that can be dropped). The same is true for
> DrRacket (not listed as a dependency), but it doesn't make much
> sense to make the XREPL package depend on DrRacket.

For these kind of things, the `dynamic-require' that gets them is
intentional not only to avoid loading code unnecessarily, but also to
avoid dependencies.


7 hours ago, Vincent St-Amour wrote:
> You could guard the `dynamic-require' with a dynamic check for the
> existence of what it's requiring. In the specific case of xrepl, the
> dynamic check should probably guard command registration so that,
> e.g. the macro stepper commands are not available if the macro
> stepper is not installed.

I think that it's much better if the commands are still available, and
just tell you that you can't use them if you try to and the
dependencies are missing.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.