On 2011-01-05, at 2:52 PM, David Dreisigmeyer wrote:
It will print before the call to __cleanup() but not after the call.
Are you sure (I've seen situations where you have to fflush(stdout); after each printf to get the output).
Please run "dtruss ipython" (you may have to do "sudo dtruss ipython") with your code to see all the system calls that are made, which might indicate quickly where things went wrong during the call to ___cleanup.
What would the downside of not calling __cleanup() be? (I'm currently using this way.)
The memory for the Scheme heap won't be deallocated (probably not much in this example, but could be as large as the code asked for). Also, some file descriptors for open files will not be closed. And the terminal settings will not be restored correctly. And some signal handlers will still be installed (and under the control of the Gambit runtime).
Marc