[plt-scheme] how to call scheme program with arguments

From: Marek Kubica (marek at xivilization.net)
Date: Sun Dec 28 05:13:35 EST 2008

Hi,

On Sun, 28 Dec 2008 08:01:54 +0100
Sigrid Keydana <keydana at gmx.de> wrote:
 
> - do I need the 'main' function as entry or are there other ways

No, calling (current-command-line-arguments) is enough.

> - how to get the arguments

Personally I recommend the command-line form:
<http://docs.plt-scheme.org/reference/Command-Line_Parsing.html>
For a program example that uses the command-line form, you can take a
look at <http://xivilization.net/hg/sandbox/file/tip/worktime.scm>.

> - whether to just have a one-liner on the command line or a whole
> shell-script-with-embedded-scheme like the one in the mzscheme man
> page (which btw does not print anything to stdout when I try it...?):

I use normal 100% Scheme files without any shell-script stuff.

regards,
Marek


Posted on the users mailing list.