[plt-scheme] MzScheme and --main
Just what I was looking for. The part that bit me was telling mzscheme
to stop reading the arguments with "--".
Thanks a lot!
On Mon, Jul 6, 2009 at 3:53 AM, Eric Hanchrow<eric.hanchrow at gmail.com> wrote:
> On Sun, Jul 5, 2009 at 12:04 PM, Rommel M. Martinez<ebzzry at gmail.com> wrote:
>> I'm lost as to how _exactly_ should one write a program, that understands
>> or uses the -m/--main argument to mzscheme.
>
> I do it like this:
>
> #! /bin/sh
> #|
> exec mzscheme --require "$0" --main -- ${1+"$@"}
> |#
>
> #lang scheme
>
> (define (main . args)
> (printf "Hello ~s~%" args)
> )
>
> (provide main)
>
--
Rommel M. Martinez
http://www.bespin.org/~ebzzry