(bind-func index_of:[size_t,!a,List{!a}*,[bool,!a,!a]*]*
"return index of first occurrence of element in lst, or -1 if not present"
(lambda (element lst pred)
(let ((f (lambda (l cnt)
(if (null? l)
-1
(if (pred element (car l))
cnt
(f (cdr l) (set! cnt (+ cnt 1))))))))
(f lst 0))))