Sam wrote:
> > - What shall Ctrl-D do? Invoke RETRY? Invoke CONTINUE? Invoke RETRY or
> > CONTINUE? What if both RETRY and CONTINUE restarts are available?
>
> C-d is always CONTINUE, never RETRY.
Actually Ctrl-D is CONTINUE if possible, otherwise ABORT.
Thanks for the patch, Ctrl-D after calling an undefined function now
works as escaping!
> > - How would you handle the ASSERT case? There, part of the problem is
> > that ANSI CL specifies that a CONTINUE restart is established. Should we
> > establish a RETRY restart as well?
>
> I think ASSERT is fine as is.
> this problem has been already solved.
Nope, when I enter (assert (integerp pi))
then Ctrl-D effectively does a retry.
What has been solved was the particular case of batch mode behaviour.
You probably have to distinguish ASSERT with some places and ASSERT with
just one argument form.
Bruno

Sam wrote:
> > Now in clisp after any ASSERT that doesn't have a place, such as
> > (ASSERT (= 3 4))
> > Ctrl-D leads to the same situation over and over again. This is annoying.
> > I don't know whether the bug is in the ASSERT macro, the CONTINUE restart
> > or the maybe-continue function.
>
> this is not a bug.
Of course it's not a bug in the sense that ANSI CL doesn't say what Ctrl-D
means.
But it's a very annoying and unfriendly behaviour, to not let the user
use the normal, simple escape command in order to escape the break loop.
> you may be able to change the global state that would make the ASSERT
> pass.
> e.g., (assert (zerop *global-error-counter*))
If the user has the time to do (setq *global-error-counter* 0), he also
has the time to look at his restarts.
> Similarly, check_fdefinition() should use RETRY and not CONTINUE.
Yes, when I call
(asdoisad 8)
I get the same annoying behaviour of Ctrl-D.
This would solve 1/3 of the problem. Now about the other parts:
- How would you handle the ASSERT case? There, part of the problem is that
ANSI CL specifies that a CONTINUE restart is established. Should we
establish a RETRY restart as well?
- What shall Ctrl-D do? Invoke RETRY? Invoke CONTINUE? Invoke RETRY or
CONTINUE? What if both RETRY and CONTINUE restarts are available?
Bruno

> * Bruno Haible <oehab@...> [2004-06-03 19:47:41 +0200]:
>
> Ctrl-D (= EOF on standard-input) has traditionally meant in Unix and clisp:
> "get outta here", "don't bother me, I don't care".
>
> Now in clisp after any ASSERT that doesn't have a place, such as
> (ASSERT (= 3 4))
> Ctrl-D leads to the same situation over and over again. This is annoying.
> I don't know whether the bug is in the ASSERT macro, the CONTINUE restart
> or the maybe-continue function.
this is not a bug.
you may be able to change the global state that would make the ASSERT
pass.
e.g., (assert (zerop *global-error-counter*))
> If a user needs to take a complex action, such as defining a function
> or method, before continuing from a continuable error, you can also
> assume that he has the time to type ":R2". But if he's in a hurry or
> wants to get out of a weird situation, let him do so just by typing
> Ctrl-D.
Similarly, check_fdefinition() should use RETRY and not CONTINUE.
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org&gt; <http://www.iris.org.il&gt; <http://www.memri.org/&gt;
<http://www.mideasttruth.com/&gt; <http://www.honestreporting.com&gt;
He who laughs last did not get the joke.

Sam wrote:
> you mean something like this:
Yes, something like this.
> may I check this in?
Check it in when it works. When the code indentation is correct. When the
error messages are internationalized. When the restart descriptions are
correct. When blindly typing typing Ctrl-D does not lead to the same error
again.
Bruno

Ctrl-D (= EOF on standard-input) has traditionally meant in Unix and clisp:
"get outta here", "don't bother me, I don't care".
Now in clisp after any ASSERT that doesn't have a place, such as
(ASSERT (= 3 4))
Ctrl-D leads to the same situation over and over again. This is annoying.
I don't know whether the bug is in the ASSERT macro, the CONTINUE restart
or the maybe-continue function.
If you don't fix it, I'll deal with it eventually. But in the mean time,
please don't make the problem worse.
If a user needs to take a complex action, such as defining a function
or method, before continuing from a continuable error, you can also assume
that he has the time to type ":R2". But if he's in a hurry or wants to
get out of a weird situation, let him do so just by typing Ctrl-D.
Bruno

>>>>> "Sam" == Sam Steingold <sds@...> writes:
Sam> Hi Bruno,
>> * Bruno Haible <oehab@...> [2004-06-03 14:10:27 +0200]:
>>
>> This was reported to sbcl-devel: clisp's ATANH function returns wrong
Sam> no wonder: CMUCL is wrong too.
It's a typo that I probably introduced when I copied the code from
Kahan's paper long ago. That patch that Christophe Rhodes posted to
sbcl-devel is the right one and matches Kahan's paper.
Sam> It appears that ATANH is the only broken one.
Sam> I will look into this...
I have not examined the others yet, but I think they are correct.
Ray

Sam wrote:
> it is possible to add RETRY restart to NO-APPLICABLE-METHOD?
> I want to be able to define the missing method and try again.
Sure. NO-APPLICABLE-METHOD receives all info that it needs through its
arguments. Write a method for it. It's not speed critical.
Bruno

Hi,
The clisp CVS now has a largely rewritten backquote implementation, based
on the older one by Kaz and Sam.
What I liked (and therefore kept):
- The separation between the mandatory part that is necessary for
ANSI CL compliance and the optimization part which deals with list
operations. This is really important: the code being so fragile,
it's important to know which code can be touched for optimizations
and which must not. This is one of the things the old optimizer from
Michael and me did not get right.
- The ability to turn optimizations on and off. It gives a good insight
about what splicing operations mean, to look at the unoptimized
macroexpansions.
What I disliked (and therefore changed):
- The order of the definitions in the file. Optimizers, read macros,
auxiliary functions, all was intermixed without any apparent order.
- The lack of a test suite for doubly-nested backquote. I mean, when
you have 15 different fragile optimizations, and no test suite to
double check the changes that are made, it is absolutely no wonder
if one of the 12 test cases from CLtL2 breaks, as it did in the 2.33
release.
- The generated code was suboptimal. I mean things like
(APPEND (LIST (foo)) (bar))
which, at runtime, conses twice as much as (CONS (foo) (bar)).
When a developer looks at such a macroexpansion, he might decide to
not use backquote because it's too inefficient. Sad - because it's
unjustified.
- The optimizers wanted to do too much and were therefore only heuristic.
By diminishing the size of the optimizable operations, I hope that I
made them less heuristic and more algorithmic.
- The bq-constant-p, eval-self-p, maybe-quote, maybe-unquote,
quoted-bq-operator-p functions. To me these looked like special-purpose
hacks with the purpose of undoing incorrect optimizations by other
parts of the code. Once I was careful enough about the optimizations,
these things could all go away.
If you have some backquote tests that the rewrite broke, please show them
so that we can add them to the testsuite.
Bruno

Hi Sam,
This was reported to sbcl-devel: clisp's ATANH function returns wrong
results:
(atanh #C(1 2)) => #C(1.0 1.1780972)
The correct result is ca. #C(0.1732868 1.1780972)
This bug was introduced between clisp-2.29 and 2.30, i.e. according to the
HISTORY file, between 2002-07-25 and 2002-09-15.
The 2002-09-11 patch modified many transcendental functions. The testsuite
ought to catch things like that. Could you please add at least 1 numerical
example with complex numbers for each of them (EXP, LOG, ..., ACOS) to our
test suite?
Bruno