[r6rs-discuss] [Formal] "#! /usr/bin/env" is not "portable." It's Unix-specific.

From: Peter Gavin <pgavin>
Date: Tue Nov 14 22:04:45 2006

On 11/14/06, Arthur A. Gleckler <arthur_at_zurich.csail.mit.edu> wrote:
> But it seems even better to remove this consideration entirely from
> the "script" file, using some OS-specific wrapper file whose format
> is perhaps the subject of an SRFI.

I dislike this idea, because a) it makes quick, one-off scripts not as
quick and easy as I would like; and b) other portable languages that
can be executed by an interpreter do not work that way; and c) I do
not believe it is necessary, since the separation of non-portable from
portable code is already possible with the current report.

I definitely agree that /usr/bin/env should not be referred to; nor
should anything be specified about what the name of the interpreter
is. That would be my greatest objection to the current "script"
specification.

I would suggest having the token #! be the start of a comment; the
comment would continue until either the end of line, or some other
token (!#, for instance) was reached. (It doesn't really matter to me
how the comment is terminated.) Like any other comment, the compiler
would completely ignore it.

This would be completely portable, and allow systems that use the #!
convention to work as expected. Other systems that do not use the
convention (Microsoft Windows is the primary example) would most
likely end up using the file extension, anyway.

In addition, I would drop the requirement that the first line be
ignored. That wouldn't be needed were #! a comment indicator.

Pete
Received on Tue Nov 14 2006 - 22:04:40 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC