[racket] "private" modules to make an opaque struct type

From: David T. Pierson (dtp at mindstory.com)
Date: Wed Feb 29 00:22:16 EST 2012

Hi all,

Many racket collections define some modules in a subdirectory named
"private".  Presumably these modules are for definitions that are used
by other modules in the same collection but are not meant to be used
from outside the collection.  As far as I can tell, this is just a
convention and is not enforced in any way.  Are there any guidelines for
such "private" modules?  I couldn't find anything searching the
documentation and the list archives.

I'm considering such a private module to define a custom struct type.
The struct's fields would be used by multiple modules in my collection,
and instances of the struct would be used outside the collection, but I
want the struct to be opaque to code outside my collection.  In other
words I'd reexport only the type predicate procedure from the main
module.  Is this a typical use of "private" modules?

Thanks for any suggestions.


Posted on the users mailing list.