guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie question regarding REST arguments from C.


From: Noufal Ibrahim
Subject: Newbie question regarding REST arguments from C.
Date: Fri, 11 Jun 2004 15:08:01 +0530
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

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-ref.

      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
      
Thank you. 

-- 
Noufal







reply via email to

[Prev in Thread] Current Thread [Next in Thread]