Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!sunic!trane.uninett.no!nac.no!news.kth.se!news.ifm.liu.se!liuida!mikpe
From: mikpe@ida.liu.se (Mikael Pettersson)
Subject: Re: ANNOUNCE: libscheme-0.5
Message-ID: <1994Oct22.104009.585@ida.liu.se>
Sender: news@ida.liu.se
Organization: Department of Computer Science, University of Linkping
References: <BRENT.BENSON.94Oct21153630@jade.ssd.csd.harris.com>
Date: Sat, 22 Oct 1994 10:40:09 GMT
Lines: 30

In article <BRENT.BENSON.94Oct21153630@jade.ssd.csd.harris.com> Brent.Benson@mail.csd.harris.com writes:
>I just uploaded libscheme-0.5.tar.gz to the Scheme repository's
>incoming directory:
>...
>New in release 0.5.
>...
>Made test interpreter and load function ignore the first line of a
>file if it begins with `#!' in order to facilitate writing executable
>scripts in a Unix environment.

This technique has one drawback though: many (most? all?) Unixes
limit the length of the #! interpreter line to the size of an
object file header, which can be as small as 32 bytes. This leaves
a puny 30 bytes for the pathname and argv, which simply isn't enough.
(Or it forces you to install every #!-able interpreter in some place
close to /, which isn't always feasible.)

For my pet scheme interpreter, I implemented a nestable comment
feature, much like #| .. |# in C-Scheme except it's spelled #! .. !#.
It allows a scheme script to be written as:

#!/bin/sh
exec <arbitrarily long path>/my-pet-scheme -f $0 $*
!#
(display "Hello, World!")
(newline)
(exit 0)
-- 
Mikael Pettersson, Dept of Comp & Info Sci, Linkoping University, Sweden
email: mpe@ida.liu.se or ...!{mcsun,munnari,uunet,unido,...}!sunic!liuida!mpe
