guile-user
[Top][All Lists]
Advanced

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

Re: Lists passed to C?


From: Marius Vollmer
Subject: Re: Lists passed to C?
Date: 20 Oct 2001 13:25:33 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

"Robert A. Uhl" <address@hidden> writes:

> I've a function declared as below:
> 
> SCM scm_mapobject_set_owners(SCM object, SCM owners_list);
> 
> It's meant to be called from scheme as:
> 
> (trav-mapobject-set-owners obj '(object object...))
> 
> The C function does get as its second argument a list (checked using
> SCM_NIMP && SCM_CONSP).  But its value is a symbol, not the symbol's
> value.  I'm guessing that this is due to the fact that the list is a
> list of symbols--that's fine.
> 
> But how do I reference that value?  I've been reading source and
> header files and am no wiser than when I started.

This is a Scheme issue, not a C API issue.  You need to use

    (trav-mapobject-set-owners obj (list object object...))

This will cause a list to be build from the sub-expressions in the
`(list ..)' form.

If you really want the C code to do the symbol lookup (which you
probably don't), you need first to determine in what module this
lookup should take place and then use scm_module_lookup.



reply via email to

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