[racket] a small programming exercise

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Oct 14 21:38:31 EDT 2010

9 hours ago, Robby Findler wrote:
> On Thu, Oct 14, 2010 at 11:09 AM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
> > 2. But could DrRacket execute RUN by
> >
> >  -- spawning a process that performs the compilation of the def window
> >  -- printing the repl prompt and allowing users to type
> >  -- and inserting results (if any) as they become available from
> >     the separate process
> >
> > If the user happens to enter the REPL text before the separate
> > thread terminates, it would have to wait. (This sounds like a
> > future.)
> >
> > The question is whether this changes the perception. -- Matthias
> This sounds like an interesting idea to me. DrRacket can make you
> wait when you hit "return" in the REPL instead of making you wait
> for the compilation/execution to finish before allowing you to hit
> return.
> There are already two (racket) threads going on here so it is just a
> question of being more sophisticated in the synchronization between
> them.

In terms of perception, I don't think that it will change much, since
very often you're waiting for some output to show up -- like some
printout about tests passing, or some test error, or some printout of
a result, or just the fact that you see the prompt which in TR's case
means that the code typechecked.

But something that is really annoying in a class situation is that drr
ignores any keypresses I hit while waiting -- very often I know what
the result is going to be, and then it can go like:

  * I type "(first foo)" and hit enter

  * Drr ignored some prefix of that, so I just entered something bogus
    and I need to fix it (takes much more time now)

  * Slightly better when I realize that it's not reponding when I type
    that prefix, so I fix it before hittin enter (still takes time)

[In my case, I often talk about what I'm typing, which means that when
I learned to wait for the prompt I also don't say anything -- and
*that* makes that pause much more noticeable.]

So a *very* welcome change IMO is for those keys to not be discarded.
I'd probably like that better than the prompt showing up (and my
typing too) and have the program's output inserted before it as I

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.