[racket-dev] raco dwim

2010-09-10 Thread Eli Barzilay
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


Re: [racket-dev] raco dwim

2010-09-10 Thread Jay McCarthy
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'.

Jay

On Fri, Sep 10, 2010 at 5:42 AM, Eli Barzilay e...@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 j...@cs.byu.edu
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

The glory of God is Intelligence - DC 93
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] raco dwim

2010-09-10 Thread Eli Barzilay
On Sep 10, Jay McCarthy wrote:
 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.

(That's why I thought that looking in the contents of a suffixless
file is bad.)  In any case, I think that a good example here is a .plt
file -- do I really have to spell things out when raco foo.plt is
pretty obvious?  (Also, it makes raco a replacement for setup-plt,
where you can throw drag and drop a plt file into it.)


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

I don't remember if this direction was raised...  I thought it was the
other way -- I remember Matthew mentioning that `racket' has a very
picky and often difficult to learn use of flag, but as a result it's
very flexible.  So it seems that raco is a natural fit for the other
extreme -- very fixed by patterns, but much easier to remember.

-- 
  ((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