How to Organize Your Racket Library [blog]

I like your post a lot, I think starting out with racket it would have helped me to get up to speed in understanding that package organization strategy.

The only thing I would like to state explicitly — because I am unsure that it is conveyed 100% to the reader — is that single-collection vs multi-collection is orthogonal to single-package vs multi-package.

You can use them in any combination you like, e.g. in my define-attributes package I use single-collection with multiple-package. Sometimes packages organized as -lib/-doc/-test use (define collection 'multi) in their combining package, even when the sub-packages all use a single collection. Starting out that gave me the impression that multi-collection was required to use multi-package but this is not true.

This is why I prefer it when the combining package uses something that matches the sub-packages, e.g. only uses multi-collection if at least one of the sub-packages does too.

I also wonder whether there should be a way to state within the info.rkt that this package has no collection / is an empty package that is strictly being used to combine the sub-packages, it feels wrong to specify a collection, when you never want it to contain something (in that particular package).
Maybe (define collection 'none) could indicate that the package has no own collection and is only composed from its sub-packages.

3 Likes