(bind-func prime_p
(lambda (p)
(if (= p 2)
#t
(if (or (<= p 1) (= (% p 2) 0))
#f
(let ((prime #t)
(to (convert (sqrt (convert p double)) i64))
(i 3))
(while (and (< i to) (not prime))
(set! i (+ i 2))
(set! prime (= (% p i) 0)))
prime)))))