B
Bill Atkins
Is there any way to cause "", [], and {} to have different behaviors.
I'd like to be able to have {} create OrderedHash's instead of Hash's,
but I don't know how to change this behavior. If I do Hash =
OrderedHash, then Hash.new will create an OrderedHash, but {} still
gives me an old-fashioned hash. If I do
def Hash.new *args
OrderedHash.new *args
end
I get the same results. Is it possible to override these built-in
constructors?
Bill
I'd like to be able to have {} create OrderedHash's instead of Hash's,
but I don't know how to change this behavior. If I do Hash =
OrderedHash, then Hash.new will create an OrderedHash, but {} still
gives me an old-fashioned hash. If I do
def Hash.new *args
OrderedHash.new *args
end
I get the same results. Is it possible to override these built-in
constructors?
Bill