From: furufuru@... (Ryo Furue) Date: 2001-09-23T11:42:28+09:00 Subject: [ruby-talk:21573] What's the "Data" class? Don't we need a namespace for standard classes? Hi there, I spent a hard time to debug my code, which boils down to something like this: class Data def hello puts "hello" end end d = Data.new d.hello The error message was ./try.rb:9: undefined method `new' for Data:Class (NameError) After a lot of trial and error, I finally found that the code works if I replace "Data" with "MyData". I guess "Data" is some predefined class. I looked into the pickaxe Ruby book but couldn't find it. This makes me think that Ruby really needs to hide its "standard library" (File, Time, Socket, etc. Is "Data" part of it?) into a single namespace and to keep the default namespace as clean as possible. Currently it's too much "polluted" (no derogatory meaning intended). C++ did this in its international standard: it hides all its standard library in the namespace "std". If you don't know C++, I illustrate the idea in pseudo-Ruby code:  f = File.open(....) # => undefined class File But require "Std"  f = Std.File.open(....) # OK Or  include Std f = File.open(....) #OK What do you think? Cheers, Ryo