unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Newbie question regarding REST arguments from C.
@ 2004-06-11  9:38 Noufal Ibrahim
  2004-06-11 13:56 ` Mike Gran
  0 siblings, 1 reply; 3+ messages in thread
From: Noufal Ibrahim @ 2004-06-11  9:38 UTC (permalink / raw)



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





_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-11 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-11  9:38 Newbie question regarding REST arguments from C Noufal Ibrahim
2004-06-11 13:56 ` Mike Gran
2004-06-11 14:37   ` Noufal Ibrahim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).