;; double each element of v (with length n) in place
(define double!
(c-lambda (scheme-object int) ; the vector and it's length
void
"//extract array from scheme object
___U16* v = ___CAST(___U16*, ___BODY_AS(___arg1, ___tSUBTYPED));
// perform the C operations
int i;
for (i=0; i<___arg2; i+=1) {
v[i] += v[i];
}"))
(define *v* (u16vector 0 1 2 3 4 5))
(display *v*)
(newline)
(double! *v* (u16vector-length *v*))
(display *v*)
has many details.
Chris D.