From: Matt Armstrong Date: 2002-01-30T02:32:30+09:00 Subject: Re: Hal Fulton's Set class David Corbin writes: > Matt Armstrong wrote: > >>David Corbin writes: >> >>> 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. >> >>See the union! method. >> > > def union!(other) > @elts |= other.elts > self > end > > This says to me, novice that I am, that another Set is expected. Yep, looks like you have to create a new Set that has the new elements you want. myset.union!(Set(1, 2, 3)) -- matt