This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Accessing Scheme lists in C?


Ian Pointer <ian.pointer@btinternet.com> writes:

> Sorry if this seems to be a silly query, but I've decided to use guile as a
> scripting language to a little computer game I'm writing, and I was wondering
> just how a C function can access the contents of a list passed to it. I can't
> find anything suitable in gh.h, and the documentation I can find is rather
> vague on the subject. Thanks...

Use the selectors SCM_CAR and SCM_CDR and the predicates SCM_NULLP and
SCM_CONSP (which corresponds to `pair?').

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]