David Corbin <dcorbin / imperitek.com> writes:

> Matt Armstrong wrote:
>
>>David Corbin <dcorbin / imperitek.com> 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