<div dir="ltr">Hem, here&#39;s a probably more multi-platform and general version (and one that I can edit on pastebin):<br><a href="http://pastebin.com/pKKpp0Tz">http://pastebin.com/pKKpp0Tz</a><div class="gmail_extra"><br>

</div><div class="gmail_extra">It&#39;s now using `syntax-source-module&#39; for the file path, but I&#39;m not sure how much I can rely on it, and it&#39;s also using <br>(find-executable-path (find-system-path &#39;exec-file))<br>

to be able to run the file independently of its name, and here too I&#39;m not sure if it will work as needed all the time.<br><br>Laurent<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 2:58 PM, Laurent <span dir="ltr">&lt;<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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" target="_blank">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>
</blockquote></div><br></div></div>