<div dir="ltr"><div><div><div><div>Hi all,<br><br></div>Here&#39;s a funny little  piece of code:<br><a href="http://pastebin.com/G9BG9v7j">http://pastebin.com/G9BG9v7j</a><br></div>When you click on the button, it appends an instruction at the end of the file, recompiles itself, closes itself and restarts itself with the new program.<br>

<br>To run in the console (won&#39;t work inside DrRacket).<br><br></div>Since I&#39;m most probably going to use a similar code in a project, if anyone has comments on how to do things better, I&#39;m all ears. <br></div>

<div><br>In particular:<br><br></div><div>- Is there a risk of memory leak somewhere with that kind of code?<br><br><div>- Is there a context in which this code may break?<br></div><br>- I&#39;m not sure about the ports with `subprocess&#39;. The docs say they must be closed, but since I&#39;m using the current ones, I thought probably not.<br>

</div><div><br></div><div>- Is `subprocess&#39; good enough for the job? Or do I need to invoke a more low level fork?<br><br></div><div>- It uses getpid from mzlib/os, which is deprecated. Is there a replacement for that? Will mzlib/os be removed in the future? (and so should I copy the relevant code into my project?)<br>

</div><div><div><br></div><div>Any other comment is appreciated.<br></div><div><br></div><div>Thanks,<br></div><div>Laurent<br></div></div></div>