<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 8, 2019 at 3:33 PM Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Guido van Rossum wrote:<br>
> I guess this explains the behavior of removing results <= 0; it makes <br>
> sense as multiset subtraction, since in a multiset a negative count <br>
> makes little sense. (Though the name Counter certainly doesn't seem to <br>
> imply multiset.)<br>
<br>
It doesn't even behave consistently as a multiset, since c[k] -= n<br>
is happy to let the value go negative.<br>
<br>
> For sets, <br>
> union and intersection are distributive over each other.<br>
<br>
> Note that this is *not* the case for + and * when used with <br>
> (mathematical) numbers... So in a sense, SETL (which uses + and *<br>
 > for union and intersection got the operators wrong.<br>
<br>
But in another sense, it didn't. In Boolean algebra, "and" and "or"<br>
(which also distribute over each other) are often written using the<br>
same notations as multiplication and addition. There's no rule in<br>
mathematics saying that these notations must be distributive in one<br>
direction but not the other.<br></blockquote></div><div><br></div><div>I guess everybody's high school math(s) class was different. I don't ever recall seeing + and * for boolean OR/AND; we used ∧ and ∨.</div><div><br></div><div>I learned | and & for set operations only after I learned programming; I think it was in PL/1. But of course it stuck because of C bitwise operators (which are also boolean OR/AND and set operations).<br></div><div><br></div><div>This table suggests there's a lot of variety in how these operators are spelled:<br></div><div><a href="https://en.wikipedia.org/wiki/List_of_logic_symbols">https://en.wikipedia.org/wiki/List_of_logic_symbols</a><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div></div></div>