guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: allow "guile foo.scm"


From: Jose A. Ortega Ruiz
Subject: Re: Proposal: allow "guile foo.scm"
Date: Fri, 12 Nov 2004 16:32:31 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Greg Troxel <address@hidden> writes:

>   What do you think of allowing guile to be run as "guile foo.scm"?
>
> I think it makes sense; /bin/sh acts like this.   Reading 'guile
> --help', this could currently only start up a guile with foo.scm in
> (command-line), but it doesn't.
>
> But, I think your example fails to pass arguments to the guile
> process.  Do you mean to include $0 address@hidden  Why can't you do
>
> #! /usr/bin/env guile -s $0 "$@"
> !#
>

IMHO, the best way would be to support SRFI-22 (Running Scheme scripts
in Unix, http://srfi.schemers.org/srfi-22/srfi-22.html), which calls a
procedure named main in the body of a script starting with

#!/usr/bin/env guile

after evaluating the body, passing to it as arguments the provided
command line ones [1]. Besides being a simple approach, it would be make
live easier for people writing code intended for multiple schemes.

Just my .02 euros,
jao

Footnotes: 
[1]  Actually, i'm oversimplifying here: the SRFI suggests also
concrete names for the interpreter (instead of just 'guile'),
according to its compliance to RnRS.

-- 
If people do not believe that mathematics is simple, it is only
because they do not realize how complicated life is. 
- John von Neumann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]