Timeline for Why would one overload the && and & operator?
Current License: CC BY-SA 2.5
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 6, 2011 at 19:27 | comment | added | dan04 | This is exactly what the Python set type does. It also uses ^ for symmetric difference. | |
| Mar 6, 2011 at 17:42 | comment | added | user281377 | Matthew Read: That would be a multiset, indeed, but A-B+B=A still doesn't hold, unless you allow negative multiplicities. | |
| Mar 6, 2011 at 17:41 | comment | added | Matthew Read | You could use + for a special union that keeps duplicates. Then - would be straightforward and A+B-B=A would indeed hold. Of course, you probably lose some nice set properties there. Is that what a multiset is? Hmm. | |
| Mar 6, 2011 at 17:03 | comment | added | user281377 | acidzombie: actually, there is no good definition of + for a set, though one might be tempted to use it for union; but obviously A+B-B=A doesn't hold (neither does A-B+B=A) | |
| Mar 6, 2011 at 10:29 | comment | added | user2528 | What should + be for a set type? | |
| Mar 6, 2011 at 10:19 | history | answered | user281377 | CC BY-SA 2.5 |