From: Jason Voegele Date: 2002-01-30T23:37:05+09:00 Subject: Re: Hal Fulton's Set class > Hal E. Fulton wrote: > >>----- Original Message ----- >>From: "David Corbin" >>To: "ruby-talk ML" >>Sent: Tuesday, January 29, 2002 5:04 AM >>Subject: Hal Fulton's Set class >> >> >>>I'm attempting to use this class >>>(http://www.hypermetrics.com/rubyset.html), and I don't see a way to >>>add individual elements to an existing Set. I'm sure I'm missing >>>something, but even the tests don't reveal anything to me. >>> >> >>Ahh... I really should remove that thing or rewrite it. >> >>I wrote it when I was learning Ruby over two years ago... I probably >>knew less about it than you know now. >> >>And there probably is no way to add elements. I'd have to >>look at it again to see. >> >>If you're interested in this, I suggest you rewrite it as an >>exercise... >> > I might do so, but I'm sure I have less experience with Ruby that you > had at the time :) You could check out this one: http://cvs.sourceforge.net/cgi- bin/viewcvs.cgi/*checkout*/rubycollections/rubycollections/rbc/set.rb? rev=HEAD&content-type=text/plain That's a Set implemented in Ruby. There's also a Set implemented in C that's significantly faster, as part of our RubyCollections project on SourceForge: http://sourceforge.net/projects/rubycollections Jason Voegele