This seems like a bug:
Pike v8.1 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
(<"foo", "bar">) | (<"some", "bar">);
(1) Result: (< /* 3 elements */ "bar", "foo", "some" >)
(<"foo", "bar">) + (<"some", "bar">);
(2) Result: (< /* 4 elements */ "bar", "bar", "foo", "some" >)
How do you figure? To me it looks like it's working exactly as intended (| gives set semantics, + gives multiset semantics).
On Fri, Mar 12, 2021 at 10:40:03AM +0100, Stephen R. van den Berg wrote:
This seems like a bug:
Pike v8.1 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
(<"foo", "bar">) | (<"some", "bar">);
(1) Result: (< /* 3 elements */ "bar", "foo", "some" >)
(<"foo", "bar">) + (<"some", "bar">);
(2) Result: (< /* 4 elements */ "bar", "bar", "foo", "some" >)
Note that the data type's name is *multi*set, so a *set* with *duplicates*. This behaviour is exactly what you should to expect after hearing the name.
https://en.wikipedia.org/wiki/Multiset
Stanislaw Klekot wrote:
On Fri, Mar 12, 2021 at 10:40:03AM +0100, Stephen R. van den Berg wrote:
This seems like a bug:
Note that the data type's name is *multi*set, so a *set* with *duplicates*. This behaviour is exactly what you should to expect after hearing the name.
Ah well, maybe I never thought twice about it. I always assumed it does not allow duplicate members (just like the keyspace of a mapping).
Nevermind.
pike-devel@lists.lysator.liu.se