[plt-scheme] how to do this in C?

From: Mike (mikee at mikee.ath.cx)
Date: Fri Jun 2 14:01:17 EDT 2006

I'm writing a few extensions to for an eventual project
I have in mind. These extensions start a command (a query)
and need to loop in a while() loop until all the data is
returned.

I think in lisp/scheme what I want to do is (typing without
reading the manual):

Scheme_Object *so;
int data;

so = scheme_make_list();
while(data = query()) {
	so = scheme_cons(scheme_make_integer_value(data, so));
}

so = scheme_nreverse(so);

return scheme_list_to_vector(so);

I don't find a scheme_nrevers() type command. Is this an
ok way to try this kind of thing? Is there a better way?

Mike


Posted on the users mailing list.