fix set Set, add toList Tally
this is another (minor) fix of #3574: the definition of set Set didn't work since set is defined at d level.
Instead we let set be equivalent to set @@ keys on hash tables. We also add a missing toList Tally.
I think Set entries be sorted when printed, just like HashTable -- I really don't like
i1 : set {a,b,c}
o1 = set {c, a, b}
o1 : Set
I don't know too much about the background on this specific topic but I agree that it shouldn't matter if hashTable keys are sorted or not. (At least all checks seem to have passed so it is probably OK.) However, a situation where this might be used (and which might cause bugs that are difficult to detect) is the case of a hash table with integer keys. One would need to look into that further and some methods may implicitly assume the keys to be sorted. A related topic concerns the "spots" function (which I learned from Dan Grayson's ChainComplex code many years ago) and which I think should be part of the core. But this "spots" function and its need has caused some controversy. The aim of the sports function is to output the sorted integer keys (if any) of a hashTable.
Rereading the changes in this PR, was toList ZZ supposed to be like
toList ZZ := n -> toList(0..n-1)
that would be pretty useful
Rereading the changes in this PR, was
toList ZZsupposed to be liketoList ZZ := n -> toList(0..n-1)that would be pretty useful
I would be worried about people using apply(toList N, ...) instead of just apply(N, ...).
These commits were included in #3929. Closing