From: Srinivas Palthepu
Subject: Problem with KCL..
Date: 
Message-ID: <1377@shakti.ncst.ernet.in>
I had a strange problem ith KCL. The STEPper in the KCL assumes always
the top-level environment irrespective of whether you call it from
top-level prompt or within a function. For example, the follwoing
expression at lip prompt gave me an error.

>(let ((a-number 10))
      (step (+ a-number 10)))

Error: The variable A-NUMBER is unbound.
Error singalled by SYSTEM::STEPPER.
..
..
>

This means I can not call stepper other than from top-level.
For example If I want to selectively stepp only particualr code
and execute rest of the program normally, I can not do in KCL.

Is it a bugg in KCL?

-srini (········@ncst.ernet.in)
From: Jeff Dalton
Subject: Re: Problem with KCL..
Date: 
Message-ID: <4581@skye.ed.ac.uk>
In article <····@shakti.ncst.ernet.in> ········@ncst.ernet.in (Srinivas Palthepu) writes:
>
>I had a strange problem ith KCL. The STEPper in the KCL assumes always
>the top-level environment irrespective of whether you call it from
>top-level prompt or within a function. For example, the follwoing
>expression at lip prompt gave me an error.
>
>>(let ((a-number 10))
>      (step (+ a-number 10)))
>
>Error: The variable A-NUMBER is unbound.
>Error singalled by SYSTEM::STEPPER.
>
>This means I can not call stepper other than from top-level.
>For example If I want to selectively stepp only particualr code
>and execute rest of the program normally, I can not do in KCL.
>
>Is it a bugg in KCL?

No.

X3J13 voted to 'clarify" that step evaluates its argument in the
current lexical environment.  I would call this a change rather
than a clarification.

However, the following macro seems to work.  

----------------------------------------------------------------------
;;; New step macro

(in-package :system)

(defvar *step-print-level* 4
  "The stepper binds *print-level* to this value.")

(defvar *step-print-length* 5
  "The stepper binds *print-length* to this value.")

(defmacro step (form)
  `(let* ((*old-print-level* *print-level*)
	  (*old-print-length* *print-length*)
	  (*print-level* *step-print-level*)
	  (*print-length* *step-print-length*))
     (read-line)				;s.b. clear-input?
     (format *debug-io* "Type ? and a newline for help.~%")
     (setq *step-quit* nil)
     (let ((*evalhook* #'stepper))
       ,form)))
----------------------------------------------------------------------

Jeff Dalton,                      JANET: ········@uk.ac.ed             
AI Applications Institute,        ARPA:  ·················@nsfnet-relay.ac.uk
Edinburgh University.             UUCP:  ...!ukc!ed.ac.uk!J.Dalton