;; A practical vector examples
;; Three variations on a theme
;;
;; Vector Proc Example XTLang
;;
(bind-func vtest_a
(let ((iters:i64 80000000)
(i:i64 0)
(a:float* (halloc iters))
(b:float* (halloc iters))
(c:float* (halloc iters)))
(dotimes (i iters)
(pset! a i (i64tof i))
(pset! b i (i64tof i)))
(lambda ()
(dotimes (i iters)
(pset! c i (* (pref a i) (pref b i))))
(if (= (ftoi64 (pref c 80000))
(* 80000 80000))
(printf "good sample!\n")
(printf "bad sample!\n"))
c)))