Hi!<div><br></div><div>I'm trying to make a procedure that takes one argument (another procedure) and converts it to a C function, assigning it to a function pointer in C. Then I want to call that function from that pointer in C.</div>

<div>I'm aware that the typical way to do this is with c-declare in a static way, but I need to be able to achieve the same without using c-declare.</div><div><br></div><div>My current attempt:</div><div><br></div><div>

<div>(define (uno) 1)</div><div>(define bind (c-lambda (scheme-object) void "simple_callable = ___CAST(void (*)(),___arg1);"))</div><div>(bind uno)</div></div><div><br></div><div><br></div><div>...then the C part, same file:</div>

<div><br></div><div><div>// before</div><div>void (*simple_callable)(void);</div></div><div><br></div><div>// after (bind uno) is executed</div><div>(*simple_callable)();</div><div><br></div><div><br></div><div><br></div>

<div>I guess that I'm doing either the input type or the cast (or both) wrong. Probably I'm assuming to much simply casting a "scheme-object" to a void(*)(). Is this what I'm trying to do even possible?</div>

<div><br></div><div>Thanks a lot!</div><div><br></div><div>Álvaro</div>