On Mon, May 02 2016, via julia-users wrote:

> I guess it's unclear whether sort(1:3, rev=true) should return 3:-1:1 or
> [3,2,1] or be an error as it currently is.

IMO in general, all pure (non-modifying) functions that operate on
objects that are isomorphic to vectors should

1) accept all representations that collect can handle (by possibly
falling back to it), and

2) be allowed to return any representation they find convenient.

Users who want a specific form (eg a Vector) should convert
themselves. So the optimal choice would be 3:-1:1 for performance, but
users should not rely on this, and write code that would work for
[3,2,1] too.

Best,

Tamas

Reply via email to