[plt-dev] renaming programs in the distribution

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Apr 20 09:07:08 EDT 2010

At Tue, 20 Apr 2010 01:27:18 -0600, Matthew Flatt wrote:
> If you run
> 
>  racket <command> ....
> 
> where <command> doesn't have a "/", "\", or "." in it, then it's a
> command dispatch. Any other use of `racket' could be like the current
> `racket' command line.
> 
>    [Yes, weird and ugly. It's the sort of ad hoc rule that we'd
>     normally flag as poor language design. But if it works out, then
>     we'll get over it.]
> 
> This rule works for scripts that start
> 
>  #! racket
> 
> because the script name will be passed to `racket' as a full path,
> which must at least have a "/".

Not true. Eli points out that if "." is in my PATH variable, then
running the script from its directory with just the script's name gives
the name to `racket' without any path prefix.

Also, being more explicit with

  #!/usr/bin/env racket run

doesn't work on many OSes (notably Linux), because "racket run" would
be parsed as a single argument.

That seems like a big problem.

Anyone see a solution that lets `racket' work for everything? Or does
this mean that we really are forced to have at least two main
executables?



Posted on the dev mailing list.