[plt-scheme] abstracting over (PLaneT) requires

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Mon Dec 1 13:53:34 EST 2008

You can re-provide required elements with all-from-out.

I tend to do this in a module called base.ss that is used by all other  
modules in the code:

     -- base.ss --

     #lang scheme
     (require (planet foo/bar:1))
     (provide (all-from-out (planet foo/bar:1)))

     -- other.ss --

     #lang scheme
     (require "base.ss")

The module acts as the abstraction.

-- Dave

> Is there any way to abstract over requires?  In particular, I'm
> interested in abstracting over the version of a PLaneT package that I
> require.  Something like
>
>  (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (=  
> MINOR))))
>
> where MAJOR and MINOR could be bound in exactly one spot.  Thus, I
> could easily do a system-wide change of which version of a-package.plt
> I am including.
>
> Thanks!
>
> Rob
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.