[racket-dev] PLaneT(2): Single vs multi-collection packages

From: Laurent (laurent.orseau at gmail.com)
Date: Thu Jun 6 07:36:38 EDT 2013

Great! Thank you very much.

On Wed, Jun 5, 2013 at 11:04 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

> More generally, I hope I haven't come across as being firmly opposed to
> the idea of single-collection packages. I intended to come across as
> being opposed to implementing the idea myself. :)
>

I wanted to give it a stab, but didn't have much time. Plus you did it way
better than I could have done anyway.


> Some other the details:
>
>  * A package's mode is recorded in the installed-package table.
>    Otherwise, a linked package could switch modes just because the
>    package directory's content changes, which would be difficult to
>    keep in sync with the low-level table of links.
>

Does it handle the  case where user A installs B's single-collection
package,
and at some point B changes its package to a multi-collection package,
triggering the updating of A's installation?

As Jay pointed out to me, putting the collection name in the "info.rkt"
> file --- instead of using the package name as the collection name ---
> makes the package content work the same even when the package is
> renamed. Otherwise, you have to know whether the package is
> single-collection or multi-collection to know whether changing the
> package's name changes its content.
>
> It's debatable whether single-collection or multi-collection would be a
> better default, but I favor multi-collection mode.
>

What I'd like is to have single-collection being the default so that the
average Joe can even not care about including a info.rkt file, and
expect the collection's name to be just the directory's name. Less burden
on the user -> more packages.
I believe most users will not even (try to) understand the concept of multi-
collection packages. To them a package is just a bunch of source files
and that's all.

Then to create a simple package, Joe only has to create a directory,
put his my-file.rkt in it, and he's done!

If at some point Joe thinks about having a different name for his package
and for his collection, it should be intuitive to him that he should say so
somewhere (i.e. in the info.rkt file).

So here is a demo patch attached to precise what I mean (without test,
would have taken me way too much time). Because it considers that
single-collections are the default, it is backward incompatible.
If info.rkt exists, it looks for 'multi-collection, and otherwise looks for
the
'collection-name string.
If info.rkt does not exist, it creates it and gives the 'collection-name
the name of the package by default.
(This of course fails if the directory is read-only, but since it's just a
useful default it should not be a problem.
This should at least work for all downloaded archives.)

Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130606/e4678669/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lib.rkt.patch
Type: application/octet-stream
Size: 1715 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130606/e4678669/attachment.obj>

Posted on the dev mailing list.