* src/low-level.scm: Function array implemented with tail recursion.
(cond ((= (pointer-address root) 0)
'())
(else
- (let loop ((i 0))
- (cond ((= i size)
- '())
- (else
- (cons (element-proc root (* element-size i))
- (loop (+ i 1)))))))))
+ (reverse
+ (let loop ((i 0) (res '()))
+ (cond ((= i size)
+ res)
+ (else
+ (loop (+ i 1) (cons (element-proc root (* element-size i)) res)))))))))
(define (get-element-address root-pointer offset)
(make-pointer (+ (pointer-address root-pointer) offset)))