  The main theorem in this paper is a far-reaching generalization of Gleason's
theorem on the weight enumerators of codes which applies to arbitrary-genus
weight enumerators of self-dual codes defined over a large class of finite
rings and modules. The proof of the theorem uses a categorical approach, and
will be the subject of a forthcoming book. However, the theorem can be stated
and applied without using category theory, and we illustrate it here by
applying it to generalized doubly-even codes over fields of characteristic 2,
doubly-even codes over the integers modulo a power of 2, and self-dual codes
over the noncommutative ring $\F_q + \F_q u$, where $u^2 = 0$..
