(bind-func take:[List{!a}*,List{!a}*,i64]*
"returns a copy of the first n elements of lst"
(lambda (lst n)
(let ((newlst (list))
(oldlst lst)
(count 0))
(while (and (< count n)
(not (null? oldlst)))
(set! newlst (cons (car oldlst) newlst))
(set! oldlst (cdr oldlst))
(set! count (+ count 1)))
(reverse newlst))))