for
abuse.The user uses the provided query (item) to implements its own comparison
var a = [1, 3, 2]
for q in a.sort_fa do q.res = q.a <=> q.b
assert a == [1, 2, 3]
Implements a sort by permutation.
# Sort an array through a `for` abuse.
# The user uses the provided query (item) to implements its own comparison
#
# var a = [1, 3, 2]
# for q in a.sort_fa do q.res = q.a <=> q.b
# assert a == [1, 2, 3]
#
# Implements a sort by permutation.
fun sort_fa: ForAbuser[CompareQuery[E]]
do
return new SortAbuser[E](self)
end
lib/for_abuse/for_abuse.nit:138,2--149,4