A New Class

2010-06-22

Add this to the list of bizarre things you can do in Ruby:


class Object
  def new
    Class.new
  end
end

p Class.new.new.new.new.new.new.new.new.new.new.new

# prints "#<Class:0x401bf9dc>"

Comments

There's some javascript trying to load some comments, and if you're reading this, it's probably not working.