GNU bug report logs -
#66696
29.1; "A bug in the function debug."
Previous Next
Reported by: Lewis Creary <lewcreary <at> cs.com>
Date: Mon, 23 Oct 2023 05:47:01 UTC
Severity: normal
Found in version 29.1
Fixed in version 30.1
Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Lewis Creary via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:
> While I was trying to diagnose a bug in the function displayed just below
> with the help of the function debug, the interim values of the lisp variables shown were inconsistent with the code being debugged. For example,
> when called with the argument 5, the first element of the remainder list should be 1 (5 divided by 2 leaves a remainder of 1). However, the fn
> debug claims that the variable `rmdr-list' has the first element 0. This is just wrong! And it has nothing to do with the problem being debugged.
>
> (defun dec-to-bin (n)
> (let ((dividend n)
> (rmdr-list nil)
> (stop-sw nil)
> (numstr "") )
> (while ((and (>= dividend 0) (not stop-sw)))
> (setq dividend (/ dividend 2)
> rmdr-list (append (list (% dividend 2)) rmdr-list) )
> (if (= dividend 0)
> (setq stop-sw t)) )
DId you get your parentheses right? The above ')' is the end of the while...
> (debug) )
> (while rmdr-list
> (setq numstr (concat numstr (number-to-string (car rmdr-list)))
> rmdr-list (cdr rmdr-list) ) )
> (string-to-number numstr) ))
This bug report was last modified 1 year and 202 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.