[CM] How to iterate through a hash-table in C?

Iain Duncan iainduncanlists at gmail.com
Mon Dec 7 19:21:54 PST 2020

Hi folks, I'm needing to iterate through the key value pairs of a hashtable
from C code in order to make some functions that convert from Max
dictionaries to S7 hashes and vice versa. I can't think of an elegant way
to do this from C. The only thing I've thought of so far is that I could
define a function to get the keys and call it from C..

ie something like

fun_get_keys = s7_eval_c_string(s7_scheme *sc, "(lambda (h)( map(
lambda(p)(car p) h )");

And then use C to call that function on my hashtable (which I have an s7
pointer to). Is that a decent approach or am I missing something pretty
obvious here?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20201207/fb499241/attachment.html>

More information about the Cmdist mailing list