Summary
3 TODOs in lib/charlie/quiter/strings.go say "move to collections_slice"
(lib/bravo), but the functions have intra-package dependencies that prevent a
straightforward move:
SortedValuesBy calls quiter.CollectSlice
SortedStrings calls quiter.Strings (also in the same file)
Moving to lib/bravo/collections_slice would require either:
- Moving
CollectSlice and Strings too (cascading move), or
- Having
collections_slice import quiter (bravo importing charlie — NATO
violation), or
- Duplicating/inlining the dependencies
Affected functions
| Function |
Dependency on quiter |
SortedValuesBy[ELEMENT] |
calls CollectSlice |
SortedValues[ELEMENT] |
uses only stdlib slices.Collect — can move as-is |
SortedStrings[ELEMENT] |
calls Strings (same file) |
Suggested approach
SortedValues can move directly since it only depends on stdlib + lib/alfa
- For the other two, either move
CollectSlice down first, or inline the
collection step using slices.Collect + an All() call
Summary
3 TODOs in
lib/charlie/quiter/strings.gosay "move to collections_slice"(lib/bravo), but the functions have intra-package dependencies that prevent a
straightforward move:
SortedValuesBycallsquiter.CollectSliceSortedStringscallsquiter.Strings(also in the same file)Moving to
lib/bravo/collections_slicewould require either:CollectSliceandStringstoo (cascading move), orcollections_sliceimportquiter(bravo importing charlie — NATOviolation), or
Affected functions
SortedValuesBy[ELEMENT]CollectSliceSortedValues[ELEMENT]slices.Collect— can move as-isSortedStrings[ELEMENT]Strings(same file)Suggested approach
SortedValuescan move directly since it only depends on stdlib + lib/alfaCollectSlicedown first, or inline thecollection step using
slices.Collect+ anAll()call