Hello,<br><br>I'm working on a project to make an iTunes plugin. I want to use Scheme as an embedded extension language for it.<br><br>I've managed to get this working using Tiny Scheme, but now would like to try to get a better (i.e. faster) Scheme implementation in there. Hopefully, I can get compiled Scheme in there, instead of interpreted.<br>
<br>Is it possible to do this with Gambit? The crux of the problem is that the scheme code cannot declare main(). Instead, it needs to provide an init function and a deinit function. My plugin would call the init function when it loads, and the deinit function when it unloads. There is no stdin or stdout. When the plugin is operating, iTunes will repeatedly call a single function, lets call it the work function. <br>
<br>(Actually, there is a stdout.. because if I call printf, the output ends up in the system log file. But I can't reassign it, and there's no stdin).<br><br>So, the init function will need to set up the scheme environment. Then, when the work function is called, it will need to reference the scheme environment, and call a scheme function in that environment to do the work.<br>
<br>I need to provide this functionality as a library that is dynamically loaded by iTunes. As I mentioned above, iTunes already declares main().<br><br>If someone could point me at some sample code that embeds Gambit in this manner, or otherwise point me in the right direction, it would be a great help.<br>
<br>Thanks,<br><br>Neil Baylis.<br><br><br><br><br>