Paging Mr. Rettig [ws Re: Explanation of macros; Haskell macros]

james anderson james.anderson at setf.de
Sun Nov 2 08:13:07 EST 2003



Marcin 'Qrczak' Kowalczyk wrote:
> 
> On Sun, 02 Nov 2003 02:01:58 -0800, Duane Rettig wrote:
> 
> > With this much openness, it doesn't seem unreasonable
> > to expect a debugger to be able to use such information to make macros
> > and the forms they expand into completely debuggable and steppable at
> > any desired level.
> 
> Does any debugger do this?

? you mean like this? wrt evaluating

(defun testf (x)
  (dotimes (i x)
    (print i)))

(step (testf 2))

==>

(testf 2)
  (block testf (dotimes (i x) (print i)))
    (dotimes (i x) (print i))
      x = 2
      (block nil (if (ccl::int>0-p #:g25) (tagbody #:g24 (print i) (locally #
#) (unless # #))) nil)
        (if (ccl::int>0-p #:g25) (tagbody #:g24 (print i) (locally (declare #)
(setq i #)) (unless (eql i #:g25) (go #:g24))))
          (ccl::int>0-p #:g25)
            #:g25 = 2
          t
          (tagbody #:g24 (print i) (locally (declare (ccl::settable i)) (setq
i (1+ i))) (unless (eql i #:g25) (go #:g24)))
            (print i)
              i = 0
            0
            (locally (declare (ccl::settable i)) (setq i (1+ i)))
              (setq i (1+ i))
                (1+ i)
                  i = 0
                1
              1
            1
            (unless (eql i #:g25) (go #:g24))
              (not (eql i #:g25))
                (eql i #:g25)
                  i = 1
                  #:g25 = 2
                nil
              t
              (progn (go #:g24))
                (go #:g24)
            (print i)
              i = 1
            1
            (locally (declare (ccl::settable i)) (setq i (1+ i)))
              (setq i (1+ i))
                (1+ i)
                  i = 1
                2
              2
            2
            (unless (eql i #:g25) (go #:g24))
              (not (eql i #:g25))
                (eql i #:g25)
                  i = 2
                  #:g25 = 2
                t
              nil
            nil
          nil
        nil
      nil
    nil
  nil
nil


v/s

(testf 2)
  (block testf (dotimes (i x) (print i)))
    (dotimes (i x) (print i))
    nil
  nil
nil


depending on whether one stepped into or over the macro form?




More information about the Python-list mailing list