<div dir="ltr">The demodularizer is not yet reliable. It's mainly been used for analyzing programs. It could be used for this purpose in the future, but it needs some love to do that!<div><br></div><div>Jay</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 4:45 PM, Jens Axel Søgaard <span dir="ltr"><<a href="mailto:jensaxel@soegaard.net" target="_blank">jensaxel@soegaard.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Perhaps the demodularizer could be used to produce a single .zo file,<br>
and the script could simply start it?<br>
<br>
    <a href="http://docs.racket-lang.org/raco/demod.html?q=raco" target="_blank">http://docs.racket-lang.org/raco/demod.html?q=raco</a><br>
<br>
/Jens Axel<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
2015-01-14 22:36 GMT+01:00 Norman Gray <<a href="mailto:norman@astro.gla.ac.uk">norman@astro.gla.ac.uk</a>>:<br>
><br>
> Leif, hello.<br>
><br>
>> On 2015 Jan 14, at 18:46, Leif Andersen <<a href="mailto:leif@leifandersen.net">leif@leifandersen.net</a>> wrote:<br>
>><br>
>> If you want it to be a single file script you can execute, you can just make your file be:<br>
>><br>
>> #!/usr/bin/env racket<br>
>> #lang racket/base<br>
>><br>
>> (module foo racket/base<br>
>>   (provide x)<br>
>>   (define x 5))<br>
>><br>
>> (module bar racket/base<br>
>>   (require (submod ".." foo))<br>
>>   (display x))<br>
>><br>
>> (require 'foo 'bar)<br>
><br>
> Well, yes, that's what I've done, with an exec trampoline at the top, but I think I'd prefer to keep the various modules separate in a more traditional fashion, to make testing and so on easier.  Hence rewriting the various (require "foo.rkt") and concatenating them in dependency order.  It's not pretty (I can just sense, and indeed share, Jay's distaste for sed-ding a Racket source file, from here!), but it seems robust, and has the straightforwardness of a single-file 'executable', without the hammer-to-crack-a-nut of 'raco exe' (though disk space is cheap, of course; and in my case it's only 6MB, so what's the odds....).<br>
><br>
> Anyway: I was stumbling towards this solution, and thought that I was surely not the first person to want this, but couldn't find anything analogous in the sections on starting Racket, so thought I must be missing something.<br>
><br>
> I suspect that what was in my head was something like Java's .jar file: a zip file containing a bundle of compiled files in a single artefact, which needs a separate executable to run, but which is boneheadedly easy to manage.<br>
><br>
> Thanks, all, for your various observations.<br>
><br>
> Best wishes,<br>
><br>
> Norman<br>
><br>
><br>
> --<br>
> Norman Gray  :  <a href="http://nxg.me.uk" target="_blank">http://nxg.me.uk</a><br>
> SUPA School of Physics and Astronomy, University of Glasgow, UK<br>
><br>
><br>
> ____________________<br>
>   Racket Users list:<br>
>   <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
--<br>
Jens Axel Søgaard<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
____________________<br>
  Racket Users list:<br>
  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jay McCarthy<br><a href="http://jeapostrophe.github.io" target="_blank">http://jeapostrophe.github.io</a><br><br>           "Wherefore, be not weary in well-doing,<br>      for ye are laying the foundation of a great work.<br>And out of small things proceedeth that which is great."<br>                          - D&C 64:33</div>
</div>