From: "Stephan Kämper" Date: 2001-07-13T16:55:09+09:00 Subject: [ruby-talk:17776] Re: What is Array#- ? Dave Thomas wrote: > > It's just that you can't have 5 apples in a set. They'd need to be in > a bag. > > Somewhat confusingly, the opposite of Array#- is array#|, for set > union. > > a = [ ] > > 5.times { a = a | [ :apple ] } > 2.times { a = a | [ :pear ] } > > p a #=> [ :apple, :pear ] > > Regards > > Dave But not that much confusing. Array#+ can't be used, it's already given waway (array concatenation). Array#- is a good choice I think: You take away something from something else. And Array#| reminds me of the logical or. Great. IIRC the 'usual' - well if you're used to it - association betwenn logical expression and set operations is to map 'or' to set union and 'and' to the section of sets. (And 'not' to the complement of the set) So... everything is fine, isn't it? Have nice rubying day. Stephan