Great! Thank you very much. On Wed, Jun 5, 2013 at 11:04 PM, Matthew Flatt <mfl...@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
lib.rkt.patch
Description: Binary data
_________________________ Racket Developers list: http://lists.racket-lang.org/dev