From: Daniel Finnie Date: 2007-02-20T22:41:27+09:00 Subject: Re: Array#uniq - Comparison doesn't use 'eql?' and 'hash' A lot of often used add-on classes use the class method [], for example Set: Set[4, 3] == Set.new(4,3) Also, you could do [4, 3].to_set Dan Wolfgang N叩dasi-Donner wrote: > Kalman Noel schrieb: >> Although you already have the answer on dclr, for this list's archives: >> Strings are handled in a special way, as shown here:... > > Then another question came up. > > There is one good reason to use class "String" in ad-hoc-tools, instead > of a new class, that uses class "String": The constants. > > If I write write > > a = "this is a string" > > an object of class "String" will be created. If I have my wrapper class > "MyString" which uses class "String", I must use some construct like > > a = MyString.new("this is my string") > > Is there some possibility to shorten this? > > Wolfgang N叩dasi-Donner > >