[plt-scheme] How should PLTCOLLECTS work?

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Mar 5 21:43:02 EST 2009

On Mar  5, Grant Rettke wrote:
> The doc says that:
> "If the PLTCOLLECTS environment variable is defined, it is combined
> with the default list using path-list-string->path-list."
> [...]

(The subject is better phrased as how *does* it work.)

The path-list function does something that is common with environment
variables that specify paths: you have a string of several paths,
separated by a ":", which are searched in order.  In addition, an
empty path means "splice the default here".  So you get:

  "/foo:/bar"  -- look in /foo and then in /bar
  "/foo:/bar:" -- look in /foo, then in /bar, and then in the default
  ":/foo:/bar" -- look in the default, then /foo then /bar
  "/foo::/bar" -- look in /foo then the default, then /bar

The last example shows why it's useful -- it allows you to both
override PLT collections, as well as specify collections that could be
overriden by PLT collections.  For example, the first is useful if you
want to try patching libraries, and the second is useful if you want
to add a library that is added to a later version of PLT and you want
to use it now but not when you upgrade.

Finally, on windows, the path separator character is ";" instead of a
colon.  (And remember the possible pitfalls with backslashes, or just
use forward slashes.)

> Setting it to "C:\collects" on Windows XP with PLt 4.1.4 results in
> this message when DrScheme is started:
> [...]
> DrScheme does not start.

Hopefully it's clear why.

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

Posted on the users mailing list.