lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Op 20 februari 2012 13:32 schreef steve donovan <steve.j.donovan@gmail.com> het volgende:

The Set class is about 20 lines; does it go in too? Currently s1+s2
means union, and s1*s2 means intersection; we still have a few
operators left to overload!  Unfortunately, we don't have += etc
available as overloads.

Well, how about s1<s2 (proper subset), s1<=s2 (normal subset) etc?  s1-s2 for "elements of s1 not in s2"?  Idiom (s1-s2)+(s2-s1) for symmetric difference.  And don't forget #s!