Render

Multiset

A bag that counts duplicates, demoing the p/moul/x/daily/multiset library.

Word frequencies

the quick brown fox jumps over the lazy dog the fox barks and the dog barks

16 words, 10 distinct.

MostCommon(5)

rankwordcount
1the4
2barks2
3dog2
4fox2
5and1

Note the ties. barks, dog and fox all occur twice and are ranked alphabetically — the order is count descending, then element ascending. That second key is not decoration: without it the ranking would fall back on map iteration order, which gno leaves unspecified, and two nodes could render different tables.

Algebra

With A = {x:3, y:1} and B = {x:2, z:1}:

opmeaningresult
Unionmax of each count{x:3, y:1, z:1}
Intersectmin, common only{x:2}
Sumcounts added{x:5, y:1, z:1}

Removal

Starting from {a:3}:

  • after Remove("a") → {a:2}
  • after RemoveN("a", 100) → {} — over-removing clears the element instead of going negative

Transactions

Calls, deploys, and child packages · indexed history

No indexed transactions for this realm yet.

Call function

No qfuncs for this package · calls stay disabled

Source (qfile)