>From the error information, the comparison of Array is not implemented yet.
On Wednesday, January 20, 2016 at 4:48:40 PM UTC+1, Ted Fujimoto wrote:
>
> Hi,
>
> In Python, we have this:
>
> >>> sorted([(1, [2,3]), (1,[2,1])])
> [(1, [2, 1]), (1, [2, 3])]
>
> In Julia, this produces a MethodError:
You should be able to write your own Base.isless function for the types you
need to support.
On Wednesday, January 20, 2016 at 7:48:40 AM UTC-8, Ted Fujimoto wrote:
>
> Hi,
>
> In Python, we have this:
>
> >>> sorted([(1, [2,3]), (1,[2,1])])
> [(1, [2, 1]), (1, [2, 3])]
>
> In Julia, this produce
We used to have lexicographic sorting of arrays but removed it. I don't
recall the reasoning.
On Wed, Jan 20, 2016 at 11:22 AM, Tim Wheeler
wrote:
> You should be able to write your own Base.isless function for the types
> you need to support.
>
>
> On Wednesday, January 20, 2016 at 7:48:40 AM U
Got it. Thanks!
On Wed, Jan 20, 2016 at 11:33 AM Stefan Karpinski
wrote:
> We used to have lexicographic sorting of arrays but removed it. I don't
> recall the reasoning.
>
> On Wed, Jan 20, 2016 at 11:22 AM, Tim Wheeler
> wrote:
>
>> You should be able to write your own Base.isless function fo
I don't know why it was removed, but if you need that to work you can define
function Base.isless(A::AbstractVector, B::AbstractVector)
a, b = length(A), length(B)
a == 0 && return b > 0
for i in 1:min(a,b)
A[i] != B[i] && return A[i] < B[i]
end
return a < b
end
and th