Nils M Holm skrev:
> On Tue, Nov 14, 2006 at 10:04:40PM -0500, Peter Gavin wrote:
>> I would suggest having the token #! be the start of a comment;
>> 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.
>
> +1
>
>> In addition, I would drop the requirement that the first line be
>> ignored. That wouldn't be needed were #! a comment indicator.
>
> Ignoring the first line would open the door to a lot of bad
> surprises for people who start learning Scheme.
In practise, implementations will probably only ignore the
first line, if it starts with a #!
> Plus it would make all one-liners two-liners, which I think
> would be rather inelegant.
If we don't treat the first line specially, then all one-liners
become two-file scripts in Unix.
The first file contains the portable Scheme script.
The other contains the magic incantation that start the
portable script.
If we want Scheme scripts to becomes just as easy as, say,
Perl scripts on Unix, there is no other solution than to
treat files, whose first line starts with #!, as a special
case.
The compromise:
* If the first line starts with #!, ignore the first line
has the consequence that a portable script won't run on Unix.
The plus side is, that a script written for Unix will run
on other systems.
--
Jens Axel S?gaard
Received on Wed Nov 15 2006 - 08:11:24 UTC