shithub: mc

ref: 3abec38baad46bc1317fc8a8b9c1fdd38494aef4
dir: /test/stdsort.myr/

View raw version
use std

const main = {
	var a = [
		3, 5, 4, 9, 7, 2, 6, 0, 1, 8,
	]

	std.sort(a[:], intcmp)
	for i in a
		std.put("%i\n", i)
	;;
}

const intcmp = {a, b
	if a < b
		-> `std.Before
	elif a == b
		-> `std.Equal
	else
		-> `std.After
	;;
}