Invert two elements in the array

var a = [10, 20, 30, 40]
a.swap_at(1, 3)
assert a      ==  [10, 40, 30, 20]

Property definitions

core $ AbstractArray :: swap_at
	# Invert two elements in the array
	#
	#     var a = [10, 20, 30, 40]
	#     a.swap_at(1, 3)
	#     assert a      ==  [10, 40, 30, 20]
	fun swap_at(a: Int,b: Int)
	do
	    var e = self[a]
	    self[a] = self[b]
	    self[b] = e
	end
lib/core/collection/array.nit:293,2--303,4

pthreads :: redef_collections $ Array :: swap_at
	redef fun swap_at(a, b)
	do
		mutex.lock
		super
		mutex.unlock
	end
lib/pthreads/redef_collections.nit:91,2--96,4

pthreads $ ConcurrentArray :: swap_at
	redef fun swap_at(a, b)
	do
		mutex.lock
		real_collection.swap_at(a, b)
		mutex.unlock
	end
lib/pthreads/concurrent_collections.nit:417,2--422,4