[racket-dev] `collection-path' Considered Brittle

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Nov 4 12:49:44 EST 2013

collection-path is legacy and should generally be removed when you find it
(I think I fixed two uses of it Saturday in fact).

But hopefully you could use collection-file-path in most cases instead of a
collections-path function.

Robby


On Mon, Nov 4, 2013 at 11:45 AM, Vincent St-Amour <stamourv at ccs.neu.edu>wrote:

>
> While looking at Asumu's `raco-find-collection' package, Asumu and I
> noticed something about the `collection-path' function that made us
> uncomfortable.
>
> `collection-path' returns *a* path where the given collection is
> located. With the package system, there can now be *multiple* such
> paths. `collection-path' returns the first one (in alphabetical order of
> package name, at first glance).
>
> This means that installing a package that extends collection `foo' can
> break code that uses `(collection-path "foo")'.
>
> For an example that's currently broken, what used to be an arrow in the
> macro stepper window is now a box with an X in it. The macro stepper
> looks for that arrow in the `icons' collection, which is now split
> between two packages. `collection-path' returns the path from the
> package that doesn't contain that arrow.
>
>
> A solution would be to provide a `collection-paths' function, that
> returns *all* the relevant paths, and add a big warning to the
> documentation of `collection-path'. A `collection-paths' function
> already exists in
> `pkgs/compiler-pkgs/compiler-lib/compiler/commands/test.rkt'.
>
>
> Vincent
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20131104/93726281/attachment.html>

Posted on the dev mailing list.