ordl(list a, b) { integer i, l, o; l = min(~a, ~b); i = 0; while (i < l) { if (a[i] != b[i]) { o = a[i] < b[i]; break; } i += 1; } i < l ? o : ~a <= ~b; } main(void) { o_(ordl(list(1, 2), list(1, 2)), "\n"); o_(ordl(list(1e2, 2), list(1e2, 2, 3)), "\n"); o_(ordl(list(1, 2, 3), list(1, 2)), "\n"); o_(ordl(list(.5, 4), list(.5, 2)), "\n"); o_(ordl(list(1, 4, 2, 3), list(1, 4, 2.1, 3)), "\n"); 0; }