Paul Brannan wrote:
> I'm unclear why this couldn't be implemented using #inherited.

It certainly could, but that requires that you have freedom to install 
your inherited hook ahead of time and that you don't interfere with an 
existing hook and that hooks added after yours reciprocate and that you 
do all the bookkeeping yourself, including dealing with your concern 
below. It's a lot of hassle for a feature that has obvious utility.

> One concern I have with Class#subclasses is that it could potentially
> prevent anonymous subclasses from being garbage collected, if not
> carefully implemented.

In JRuby it's very simple; as classes are created they're added to a 
weak set in their parent class. When they're dereferenced, they 
eventually (fairly quickly) get collected from that set.

- Charlie