[racket] Tricking PLaneT out of eagerly installing dependencies

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Fri Jan 27 22:24:34 EST 2012


I don't think there's anything about your library that suggests a dynamic
dependency; as a user, I would be more surprised by a long pause for a
planet install during operation than by a slightly longer installation when
I first download the package.  I suggest you require the rsound package
directly, and either split your package in two to reduce dependencies or
just live with a possibly unnecessary dependency.  I guess it depends on
whether clements/rsound is significantly bigger or slower to install than
your package or not.  Personally, as a Planet user, if I downloaded an Ogg
Vorbis library, I would not begrudge it a dependency on an extra sound
library for potential conversions.

Carl Eastlund

On Fri, Jan 27, 2012 at 8:47 PM, Michael W <mwilber at uccs.edu> wrote:

> Hello everyone!
> I'm making an Ogg Vorbis library for racket, and it's convenient
> to also be able to convert Ogg files to rsounds for (planet
> clements/rsound). To this end, I have an rsound-compat module in
> my package.
> Not everyone who uses my package will want to pull down (planet
> clements/rsound) as a dependency when they install my package,
> but they might want it when they use rsound-compat.
> Is there a way of asking a planet _not_ to pull down that
> dependency when users install this package, but _do_ install that
> dependency when they try to use rsound-compat? Or should I just
> bite the bullet and split rsound-compat into its own mini-planet
> package?
> As a workaround, I have this at the top of my rsound-compat
> module, which is just enough to trick raco make but I feel icky
> after typing it:
> (define mono-signal->rsound (dynamic-require '(planet clements/rsound)
> 'mono-signal->rsound))
> (define signals->rsound (dynamic-require '(planet clements/rsound)
> 'signals->rsound))
> (define s16max/i (dynamic-require '(planet clements/rsound)
>                                  's16max/i))
> (define default-sample-rate (dynamic-require
>                             '(planet clements/rsound)
>                             'default-sample-rate))
> ;; And whatever other bindings I need
> Is this the preferred way of doing it? Am I missing something
> obvious? Does such abuse go against PLaneT's philosophy or
> something?
> --
> Reclined in a defunct and truly obese satellite dish,
>    _mike
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120127/22d873d4/attachment-0001.html>

Posted on the users mailing list.