[racket-dev] raco dwim

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Fri Sep 10 07:47:37 EDT 2010

This seems like a coherent thing for it to do, but not something that
I would personally use. I don't think I'd use it or like having it
there because the more complicated the algorithm it uses to choose
what to run, the more complicate the algorithm I run in my brain to
predict what it will do has to be. Basically, I think I am likely to
make mistakes this way.

As an aside, I thought we talked about this back when 'raco' was
created about whether it should also serve as 'racket'.


On Fri, Sep 10, 2010 at 5:42 AM, Eli Barzilay <eli at barzilay.org> wrote:
> I'm revising my course content now, and I ran into the change that
> Robby committed a while ago to `raco setup' where it no longer
> installs plt files by default.  I didn't know what would be the best
> thing to do with it, but I think that there's no problems keeping such
> instructions with setup-plt -- since the files are still ".plt" files.
> But when I was thinking about that, I reazlied that since `raco' looks
> for the first unambiguous prefix, it's doing a kind of a dwim search.
> So why not go the whole way?  Running raco with some string can:
>  * Run the specified command if there is one.
>  * If it specifies a valid (symbolic) require, require it (as in
>    `racket -l') -- a `foo' collection is effectively defining a
>    `raco foo' command, and the same for `foo/bar'.
>  * If it specifies an existing filename that looks like
>    - "*.rkt", require the file (as in `racket -u')
>    - "*.rktl", load the file (as in `racket -r')
>    - "*.plt" (possibly more than one), install it
>    [Otherwise it can look in the file for some magic header and
>    decide what to do ("#lang" => require it, some future magic string
>    for a package file => install it), but this might be a bad idea:
>    sticking to a .suffix means that it can be made reliable if raco
>    commands cannot use "." or ".suffix" for the few knowns suffixes.]
>  * If something was required (through a symbolic require path or
>    "*.rkt"), and if doing so provided a `#%top-interaction' binding,
>    then start a repl.  (Or do that with a language configuration
>    option.)
> ?
> --
>          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                    http://barzilay.org/                   Maze is Life!
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the dev mailing list.