4 Commits
Author SHA1 Message Date
Karoy Lorentey ae641c3d5d [BitArray] Fix description implementation; update tests 2024-01-31 19:34:36 -08:00
Karoy Lorentey 0da60c2075 [BitArray] Enclose description in angle brackets
This prevents producing an empty string for the `description` of an empty bit set, and thus prevents us from having to include a diverging `debugDescription`.
2024-01-30 17:58:52 -08:00
Karoy Lorentey 09c09f0f73 Fix CustomStringConvertible/CustomDebugStringConvertible conformances
- For CustomStringConvertible, `description` should print elements using `String(reflecting:)` rather than `String(describing:)`, to avoid element output from interfering with syntactically relevant punctuation within structured list displays.
- To make this work without making displays overly verbose, make `debugDescription` mostly the same as `description`, except for escaping raw string displays when and if needed.
- Avoid printing type names in `debugDescription` — it is generally not helpful, as the type is already easily accessible elsewhere. Including it makes for overly verbose displays when the type serves as an Element of a collection.
- Avoid having `debugDescription` return the empty string — it can be confusing when such a description appears in list displays.

Resolves #301.
2023-07-06 17:25:11 -07:00
Karoy Lorentey 4281dc4482 [BitArray] Change description to print bit arrays as binary numerals
This matches std::bitset, and it seems to be the more logical option.
2023-01-31 17:39:46 -08:00