Welcome to the CHICKEN Scheme pasting service

Creating a vector from C added by dieggsy on Thu Sep 17 08:53:05 2020

(import miscmacros srfi-1)


#>

C_word vector_iota(int count, int start, int step) {
    C_word *ptr = C_alloc(C_SIZEOF_VECTOR(count));
    C_word
        *p = ptr,
        *p0 = p;

    *(p++) = C_VECTOR_TYPE | count;
    while(count--) {
        *(p++) = C_fix(start);
        start+=step;
    }
    ptr = p;
    C_return((C_word)p0);
}

<#

(define vector-iota
  (foreign-lambda scheme-object "vector_iota" integer integer integer))

(print (vector-iota 10 0 2))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the result of `(apply + (list -3 4 2))'?
Visually impaired? Let me spell it for you (wav file) download WAV