(bind-func swap:[List{!a}*,List{!a}*,i64,i64]* ;; swap ith and jth list elements inplace (lambda (lst i j) (let ((ith_val (nth lst i))) (set_car (nth_tail lst i) (nth lst j)) (set_car (nth_tail lst j) ith_val)) lst))