Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: Release 1.6
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:OS X, 10.8
-
Patch:Code
Description
The doc for partition states "In case there are not enough padding elements, return a partition with less than n items."
However, the behavior of this function is as follows:
user=> (partition 3 (range 10))
((0 1 2) (3 4 5) (6 7 8))
user=> (partition 4 (range 10))
((0 1 2 3) (4 5 6 7))
user=> (partition 5 (range 10))
((0 1 2 3 4) (5 6 7 8 9))
Either the doc should be updated to make it clear that not providing a pad will mean that items are dropped, or the functionality of partition should be fixed to the following:
user=> (partition 3 (range 10))
((0 1 2) (3 4 5) (6 7 8) (9))
That would be a potentially breaking change for some people's code that uses partition. partition-all behaves as you wish.
Also, your concern with the documentation is for when there are padding elements specified as an argument, but your examples don't specify any padding elements.