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

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Tue Nov 26 08:56:31 EST 2013

In order for the OC button to only be shown in typed languages, their
`lang/reader.rkt' files [1] need to specify which buttons should be
shown by DrRacket, which requires `dynamic-require'ing OC.

If there's a better way to do it, I'd be happy to change that code.

Vincent


[1] e.g. pkgs/typed-racket-pkgs/typed-racket-lib/typed/racket/lang/reader.rkt



At Tue, 26 Nov 2013 07:36:23 -0600,
Robby Findler wrote:
> 
> [1  <text/plain; UTF-8 (7bit)>]
> Why does TR have to do something special for DrRacket? Can't it just depend
> on the (small) package drracket-plugin-lib? There should then be no need
> for dynamic-requires.
> 
> Robby
> 
> 
> On Tue, Nov 26, 2013 at 7:12 AM, Vincent St-Amour <stamourv at ccs.neu.edu>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.
> >
> > That's what Typed Racket does to decide whether to register the
> > Optimization Coach button in DrRacket.
> >
> > Vincent
> >
> >
> >
> > At Tue, 26 Nov 2013 01:55:08 -0500,
> > 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.
> > >
> > > Is there a best practice for these kinds of cases yet?
> > >
> > > Cheers,
> > > Asumu
> > > _________________________
> > >   Racket Developers list:
> > >   http://lists.racket-lang.org/dev
> > _________________________
> >   Racket Developers list:
> >   http://lists.racket-lang.org/dev
> >
> [2  <text/html; UTF-8 (quoted-printable)>]
> 

Posted on the dev mailing list.