Closed llrs closed 4 years ago
Empty sets are allowed but not shown, when printing. Will modify the documentation. The problem was with creating sets from list with empty characters. I enabled it but at the cost of not allowing to create an empty TidySet from a list. Not sure if it is worth to create an empty object to fill it later. I think there are enough methods to create a TidySet when needed (This also avoid the creation and extension pattern that is slow).
I didn't check for empty lists, now I added three more tests for these cases.
Document and test the handling of empty sets
A
TidySet
is a set of elementsThe "right" behaviour of
sets(s)
is debatable, but whatever you decide, the behavior of edge cases should be documented and covered in the test suite. I have no problem with the empty set disappearing, though it could cause problems with downstream code if the user assumes every input set will be listed insets(s)
.In the
sets
documentation, I think the behavior would be clear if you just changed the Description to, "Given a TidySet, retrieve all non-empty sets or substitute them".