Hello everyone,
I have a question regarding calling C functions with REST
arguments.
Basically, I have a 2D array made using
(define foo (create-array (make-array 0 10 10))
And then I do a
(array-set! foo 1 5 5 )
Now, to access this element from the scheme side of the program, I
can do
(array-ref foo 5 5)
And I get a 1
What I want to know is how do I frame the C equivalent of this
array reference.
The problem is that the function needs to accept a REST argument
that contains the indices of the array. How do I do this?
scm_uniform_vector_ref(scm_c_lookup("foo"),SCM_LIST2(SCM_MAKINUM(5),SCM_MAKINUM(5)));
errors out saying
ERROR: Wrong number of arguments to uniform-vector-ref
Any sample code snippets on how to do this?
Thank you.