my-test28   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm

Implementation

;; This allows you to do things like create an array
;; with an offset
(bind-func my-test28
  (lambda ()
    (let ((arr:|32,i64|* (alloc))
          (arroff (aref-ptr arr 16))
          (i 0)
          (k 0))
      ;; load arr
      (dotimes (i 32) (aset! arr i i))
      (dotimes (k 16)
        (printf "index: %lld\tarr: %lld\tarroff: %lld\n"
                k (aref arr k) (pref arroff k))))))


Back to Index