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

From: Per Bothner <per>
Date: Wed Nov 15 12:16:29 2006

As pointed out, for a Scheme system that supports #!optional #!eof
#!null etc keywords we can't just define "#!" as a comment delimiter.
Kawa's solution is to define "#!/" as a 3-character comment delimiter
which skips to the end of the line. Kawa only treats "#!/" as a comment
at the beginning of a source file, but that may be difficult for
some implementations to check.

When you need to pass extra options you can use Kawa's
"--script2 FILENAME" which run the named file as a source file,
skipping the first two lines. This allows:

#!/bin/sh
exec kawa --various --options --script2 "$0" "$_at_"
(define (foo) ...)
(foo ...)
-- 
	--Per Bothner
per_at_bothner.com   http://per.bothner.com/
Received on Wed Nov 15 2006 - 12:17:15 UTC

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