Actually, the `plt-r6rs` executable seems like it might be a better choice
than `racket`, but trying that revealed a problem: given the following
program as "shebang.ss":
#!/usr/bin/env scheme-script
#!r6rs
(import (rnrs io simple))
(display "Yay!\n")

Running via DrRacket, "racket shebang.ss", or "./shebang.ss" (given a
`scheme-script` based on `racket` and the executable bit set) works as
expected, but running via "plt-r6rs shebang.ss" or a `scheme-script` based
on `plt-r6rs` prints the following error:
shebang.ss:1:2: illegal character after `#!' in input: `/'
  context...:
   /Applications/Racket v6.11/collects/syntax/readerr.rkt:6:2:
raise-read-error9
   /Applications/Racket v6.11/collects/syntax/module-reader.rkt:186:17: body
   /Applications/Racket v6.11/collects/syntax/module-reader.rkt:183:2:
wrap-internal
   wrap-internal/wrapper
   /Applications/Racket v6.11/share/pkgs/r6rs-lib/r6rs/run.rkt:54:2:
r6rs-read-syntax
   /Applications/Racket v6.11/collects/syntax/modcode.rkt:62:2: reader
   /Applications/Racket v6.11/collects/syntax/modcode.rkt:279:5: compile-one
   /Applications/Racket v6.11/share/pkgs/r6rs-lib/r6rs/run.rkt: [running
body]

(Adding a space between the `#!` and `/usr/bin/env` doesn't help.)

-Philip

On Sun, Dec 10, 2017 at 9:34 AM, Philip McGrath <phi...@philipmcgrath.com>
wrote:

> This morning I stumbled across Appendix D to R6RS (
> http://www.r6rs.org/final/html/r6rs-app/r6rs-app-Z-H-6.html), which
> suggests that implementations provide an executable named scheme-script for
> the purpose of executing portable scripts. It seems that Racket does not
> currently provide such an executable. Should it? (Of course I understand
> that Racket is not a Scheme implementation, but it does contain an R6RS
> implementation.)
>
> The rationale given in the report seems persuasive to me, having at least
> a little bit of experience wrangling Unix-style scripts that try to be
> somewhat portable. It seems like just making scheme-script an alias for the
> racket executable would be sufficient.
>
> -Philip
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to