JuliaLang/julia — pull request #7072 by wsliang (2014-06-02 00:47:29+00:00)
Title: Implement corner cases for partitions

This PR implements ``partitions(n, m)`` for the case where ``n = 1`` and the case where ``m > n``, as well as the analogous situation for ``partitions(v::AbstractVector, m)``.

New behavior:
````
julia> collect(partitions(5, 1))
1-element Array{Any,1}:
[5]

julia> collect(partitions(5, 10))
0-element Array{Any,1}

julia> collect(partitions([1,2], 1))
1-element Array{Any,1}:
[[1,2]]

julia> collect(partitions([1,2], 3))
0-element Array{Any,1}
````