<div dir="ltr"><div>Looks good!</div><div><br></div><div>A naive question: how does C behave if you assume that the called function has a signature</div><div>of (s7_scheme* sc) and you try to pass (s7_scheme* sc, s7_pointer args) ?</div><div><br></div><div>If the extra argument doesn&#39;t cause trouble I guess the init_args could be always passed (defaulting</div><div>to s7_nil if not existing in the passed environment)</div><div><br></div><div>Slightly out of topic: just notice the snake case How come it&#39;s not &quot;init-func&quot;? <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 22 Oct 2020 at 19:17, &lt;<a href="mailto:bil@ccrma.stanford.edu">bil@ccrma.stanford.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It looks like init_args can work:<br>
<br>
tlib.c (using linux below):<br>
<br>
#include &lt;stdio.h&gt;<br>
#include &lt;stdlib.h&gt;<br>
#include &quot;s7.h&quot;<br>
<br>
static s7_pointer a_function(s7_scheme *sc, s7_pointer args)<br>
{<br>
   return(s7_car(args));<br>
}<br>
<br>
void tlib_init(s7_scheme *sc, s7_pointer args);<br>
void tlib_init(s7_scheme *sc, s7_pointer args)<br>
{<br>
   fprintf(stderr, &quot;tlib_init: %s\n&quot;, s7_object_to_c_string(sc, args));<br>
   s7_define_function(sc, &quot;a-function&quot;, a_function, 0, 0, true, &quot;&quot;);<br>
}<br>
<br>
<br>
gcc -fPIC -c tlib.c<br>
gcc tlib.o -shared -o tlib.so -ldl -lm -Wl,-export-dynamic<br>
<br>
/home/bil/cl/ repl<br>
&lt;1&gt; (load &quot;tlib.so&quot; (inlet &#39;init_func &#39;tlib_init &#39;init_args (list 1 2 <br>
3)))<br>
tlib_init: (1 2 3)<br>
#f<br>
&lt;2&gt; (a-function 1 2 3)<br>
1<br>
<br>
<br>
I think you&#39;ll need to remember which form you&#39;re using -- if you<br>
call the no-args init func with args or vice versa, all bets are off.<br>
<br>
<br>
</blockquote></div>