;checks if array is empty. Returns 1 if empty.
(bind-func is_empty
(lambda (buffer:i64* size:i64)
(let ((n:i64 0)
(stop:i64 1))
(while (and (< n size) (= stop 1))
(cond ((= (pref buffer n) 0)
(set! n (+ n 1)))
(else
(set! stop 0))))
stop)))