From: Steve
Subject: Clisp debugging a good tutorial?
Date: 
Message-ID: <1169571687.514756.29240@l53g2000cwa.googlegroups.com>
Sorry for posting this, but I haven't been able to find a tutorial on
debugging in clisp.  Does anyone know of any?

For example, what is the difference between STORE-VALUE and USE-VALUE
[1]> (aa 1 2)

** - Continuable Error
EVAL: undefined function AA
If you continue (by typing 'continue'): Retry
The following restarts are also available:
STORE-VALUE    :R1      You may input a new value for (FDEFINITION
'AA).
USE-VALUE      :R2      You may input a value to be used instead of
(FDEFINITION 'AA).

Then if I for example selec :R1 what should be entered next
(yes I realize this depends on what you are trying to do, just give me
a example that does anything)

Break 1 [2]> :R1

New (FDEFINITION 'AA):      

Steve

From: Richard M Kreuter
Subject: Re: Clisp debugging a good tutorial?
Date: 
Message-ID: <878xftty53.fsf@progn.net>
"Steve" <···········@gmail.com> writes:

> Sorry for posting this, but I haven't been able to find a tutorial on
> debugging in clisp.  Does anyone know of any?
>
> For example, what is the difference between STORE-VALUE and USE-VALUE
> [1]> (aa 1 2)
>
> ** - Continuable Error
> EVAL: undefined function AA
> If you continue (by typing 'continue'): Retry
> The following restarts are also available:
> STORE-VALUE    :R1      You may input a new value for (FDEFINITION
> 'AA).
> USE-VALUE      :R2      You may input a value to be used instead of
> (FDEFINITION 'AA).
>
> Then if I for example selec :R1 what should be entered next
> (yes I realize this depends on what you are trying to do, just give me
> a example that does anything)
>
> Break 1 [2]> :R1
>
> New (FDEFINITION 'AA):      

STORE-VALUE and USE-VALUE are two standard restart classes, described
in chapter 9 of the the Common Lisp HyperSpec [1].  Here's what the
CLHS says:

| the ‘store-value’ restart is generally used by handlers trying to
| recover from errors of types such as ‘cell-error’ or ‘type-error’,
| which may wish to supply a replacement datum to be stored
| permanently.

| the ‘use-value’ restart is generally used by handlers trying to
| recover from errors of types such as ‘cell-error’, where the handler
| may wish to supply a replacement datum for one-time use.

So if you want to AA to have a function binding just for the current
case, invoke the USE-VALUE restart.  If you want the function binding
to be permanent, invoke STORE-VALUE.

As for the larger question about debugging, I don't know of any
tutorials offhand, but you might find Kent Pitman's paper "Exceptional
Situations In Lisp" [1] useful for understanding the role of the
condition system, which plays a part in debugging.

--
RmK

[1] http://www.lisp.org/HyperSpec/FrontMatter/index.html

[2] http://www.nhplace.com/kent/Papers/Exceptional-Situations-1990.html
From: Pascal Bourguignon
Subject: Re: Clisp debugging a good tutorial?
Date: 
Message-ID: <877ivdfwxs.fsf@thalassa.informatimago.com>
"Steve" <···········@gmail.com> writes:

> Sorry for posting this, but I haven't been able to find a tutorial on
> debugging in clisp.  Does anyone know of any?

http://www.cliki.net/TutorialClispDebugger


> For example, what is the difference between STORE-VALUE and USE-VALUE
> [1]> (aa 1 2)
>
> ** - Continuable Error
> EVAL: undefined function AA
> If you continue (by typing 'continue'): Retry
> The following restarts are also available:
> STORE-VALUE    :R1      You may input a new value for (FDEFINITION
> 'AA).
> USE-VALUE      :R2      You may input a value to be used instead of
> (FDEFINITION 'AA).
>

In this case, it's the function slot of the symbol AA that is not bound.

You can either use another function value, without modifying the
function slot of the symbol AA, (USE-VALUE), or you can store a
function value in this function slot, thus making AA fboundp, and go
on using this function.


> Then if I for example selec :R1 what should be entered next
> (yes I realize this depends on what you are trying to do, just give me
> a example that does anything)
>
> Break 1 [2]> :R1
>
> New (FDEFINITION 'AA):      

It's asking you a new function definition for the symbol AA.

C/USER[5]> (aa 1 2)

*** - EVAL: undefined function AA
The following restarts are available:
USE-VALUE      :R1      You may input a value to be used instead of (FDEFINITION 'AA).
RETRY          :R2      Retry
STORE-VALUE    :R3      You may input a new value for (FDEFINITION 'AA).
ABORT          :R4      ABORT
C/Break 1 USER[6]> :r1
Use instead of (FDEFINITION 'AA): #.(function +)

3
C/USER[7]> (aa 1 2)

*** - EVAL: undefined function AA
The following restarts are available:
USE-VALUE      :R1      You may input a value to be used instead of (FDEFINITION 'AA).
RETRY          :R2      Retry
STORE-VALUE    :R3      You may input a new value for (FDEFINITION 'AA).
ABORT          :R4      ABORT
C/Break 1 USER[8]> :r1
Use instead of (FDEFINITION 'AA): #.(function /)

1/2
C/USER[9]> (aa 1 2)

*** - EVAL: undefined function AA
The following restarts are available:
USE-VALUE      :R1      You may input a value to be used instead of (FDEFINITION 'AA).
RETRY          :R2      Retry
STORE-VALUE    :R3      You may input a new value for (FDEFINITION 'AA).
ABORT          :R4      ABORT
C/Break 1 USER[10]> :r3
New (FDEFINITION 'AA): #.(lambda (x y) (make-list y :initial-element x))

(1 1)
C/USER[11]> (aa 1 2)
(1 1)
C/USER[12]> 



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Cats meow out of angst
"Thumbs! If only we had thumbs!
We could break so much!"