[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

last try (was: while-no-input)

From: Stefan Monnier
Subject: last try (was: while-no-input)
Date: Fri, 01 Nov 2002 23:07:02 -0500

> C-g is pretty much like an error even if not exactly.
> Quitting is not an anomaly, but it is not normal.
> The arrival of more input is normal.

Not while you're inside `while-no-input'.  In the cases where I want
to use it, the arrival of user input is definitely not normal:
the code within while-no-input should normally run to completion
before the user hits a key.
And the code run inside `while-no-input' (typically tramp or ange-ftp)
usually has no idea that it might be interrupted by some keyboard input,
so such an occurrence is (for the running code) definitely not normal.

> Please don't ask me to spend more time on this.
> I have lots of other work to do, and I've made the decision.

But this decision is just wrong.
I will probably not install it if that means having to use throw
for one case and signal for the other: too much work to uglify
a simple and clean design.

Another reason to use signal is that `throw' has the disadvantage
that you cannot catch the signal so any code you might want to run
"in case the execution is aborted" will need to use unwind-protect.
This might be the right tool in many cases, but not all.

Catch and throw work well when the two places where they occur are
conceptually linked and where the author has some control
over the code that is being unwound (i.e. the code between the catch and
the throw).  In the cases where I want to use while-no-input,
I have no control over this code (otherwise I could have added some
polling directly in that code).

If you don't want to spend time on it, please give a bit
of trust to those who are willing to spend the time.  I have spent
much more time thinking about the feature than implementing it,
so don't just assume that I want to use `signal' because the
implementation is simpler.  I also have spent much more time
thinking about it than you have, so I deserve a bit more credit.


PS: Kim, if you want this feature, you're probably better off
    doing the remaining work, because I'm fed up with this arguing.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]