I’ve found an article on Ruby which criticizes Ruby’s lack of
package & namespace support. (Sorry I forgot the URL)
As you know, every modern language has namespace facility.
Even XML does have one to avoid name conflicts. Contrarily,
Ruby does not have explicit namespace facility. Though module
can provide with namespace facility it is not mandatory and
is not being used even in standard library.
So, I’d like to ask two questions:
Don’t you think Ruby need a package/namespace concepts?
How would you solve the following problem:
[Start of a.rb]
I want to declare class Struct because I love that name so much.
The name Struct perfectly describes my domain problem as well.
Foo = Struct.new :bar # I’d like to use Struct in standard library.
[end of a.rb]