Tomas Matousek wrote:
> Well, that's interesting. Then this seems to be the only assignment that has side-effect on RHS, which I would argue nobody expects (or do you?). I think it makes more sense to do naming in class definition construct rather than to check whether RHS is an anonymous class on each constant assignment.
> 
> Hence I consider this a bug.

It would not be directly possible for Class.new to assign a constant in 
the caller's scope, since by calling Class.new you're activating a new 
containing constant scope. So the behavior you're looking for would 
require at least as much magic to implement.

The first-const-assign-names-anonymous-class behavior is still a little 
bit magic, but it's at least a bit more explicit. Class.new creating 
constants in the caller's scope would be much more peculiar in my opinion.

- Charlie