Q: Ruby's class expression---how is it different from `Class.new`? In Ruby, classes are just objects of class Class. So we can instantiate new classes by sending the message new to Class, like so:
Rat = Class.new do
  def initialize(name); @name = name; end
  def squeak; "#{@name} says squeak"; end
end

marshi = Rat.new 'Marshmallow'
puts marshi.squeak

This works exactly, I think, as if I replaced the first line with
class Rat

which is a class expression (according to Section 7.1.1 in Matz's book). So it appears that a class expression is nothing but syntactic sugar. If this is the case, where is this fact authoritatively expressed? Is it in the Ruby source? Docs?
If not, is there anything that the class expression does differently than calling Class.new directly? All I've been able to determine is that the class expression returns the last expression (which would be the squeak method) but doing the assignment with Class.new and the block returns the new class itself. But that does not seem to me justification for adding the class expression syntax, so I think I might be missing something.
