From: d.s.zicherman
Subject: single stepping in CLISP environment
Date: 
Message-ID: <63cojd$18bc$1@rtpnews.raleigh.ibm.com>
hello,

i am using CLISP for a small project to help me learn LISP. i would like
to set a break point in my code to pause execution, then single step 
from then on out to observe the program flow. i found how to use the 
(break) form, but i cannot find how to single step the execution in this
environment. would someone please provide an answer? you help would be 
appreciated...


       > <   > <    > > < <     > > > < < <     > > < <    > <   > <
-Z
                    be with nature as often as you can,
                  taking care to move lightly, disturbing
                as little as possible and destroying nothing.

       > <   > <    > > < <     > > > < < <     > > < <    > <   > <
From: Bruno Haible
Subject: Re: single stepping in CLISP environment
Date: 
Message-ID: <998p7140@clisp.cons.org>
> i am using CLISP for a small project to help me learn LISP. i would like
> to set a break point in my code to pause execution, then single step 
> from then on out to observe the program flow. i found how to use the 
> (break) form, but i cannot find how to single step the execution in this
> environment.

First, you have to put a call to  (break)  into your code. If your starting
point is the entry or exit of a function, you can use the
(trace (fn-name :pre-break-if t))  or  (trace (fn-name :post-break-if t))
commands.

Then you start your program, uncompiled. You don't need to put a (step...)
around the call. At the break prompt, you just do

    1. Break> (step-on)
    1. Break> continue

When you are tired of stepping, do

    Step n> (step-off)
    Step n> continue

The functions `step-on' and `step-off' are not part of clisp, please find
them below.

                        Bruno Haible


(defun step-on ()
  (declare (compile))
  (setq sys::*step-level* 0
        sys::*step-quit* most-positive-fixnum
        *evalhook* #'sys::step-hook-fn
) )

(defun step-off ()
  (declare (compile))
  (setq sys::*step-quit* 0)
)