> On 21 Jul 2017, at 21:30, Darren Duncan <dar...@darrenduncan.net> wrote: > > On 2017-07-21 5:07 AM, Timo Paulssen wrote: >> You want (|) to get the union of two sets as a set. >> >> https://docs.perl6.org/language/setbagmix#Set%2FBag_Operators >> >> hth >> - Timo > > Right. Every set operation except 1 (multiset sum) should result in a set, > and is just a special case of the same behavior as the bag operation. > Optionally the Set implementation of multiset sum could toss the duplicates > and still result in a Set, thus being an alias for union with Sets, rather > than resulting in a bag that it otherwise normally would. Depends on > designer prefs I suppose. > > Now, looking at that link, I can see at least 2 things that perhaps ought to > be changed. > > Firstly, I believe ∆ (U+2206) is the standard symbol for symmetric > difference, and not circled minus as the above url currently gives.
https://en.wikipedia.org/wiki/Symmetric_difference seems to agree, showing it as the first choice. However, ⊖ appears to be the second choice. FWIW, I think ∆ better matches the Texas variant (^) . > Secondly, I see there's an operator for multiplying 2 bags (which I hadn't > heard of before, but okay), but there should also be an operator for > multiplying 1 bag by a natural number, that is a scalar multiply of a bag. > Unless it is assumed the standard hyper-operator syntax is best for this. If I get this right, you’d want: <a b b>.Bag * 3 give (:3a,:6b).Bag ? I guess that with * being commutative, 3 * <a b b>.Bag would be the same result. But then, what would <a b b>.Bag * <a a b>.Bag be? Liz