From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#66696: 29.1; "A bug in the function debug." Date: Mon, 23 Oct 2023 08:57:09 +0200 Message-ID: References: <1239664521.598080.1698039706916.ref@mail.yahoo.com> <1239664521.598080.1698039706916@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6705"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: lewcreary@cs.com To: 66696@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 08:57:59 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1quosx-0001SM-Ju for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 08:57:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quosh-0007su-It; Mon, 23 Oct 2023 02:57:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quosc-0007sE-ST for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 02:57:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quosX-0003FS-2S for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 02:57:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quosz-00085X-MA for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 02:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Oct 2023 06:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66696 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Lewis Creary via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Lewis Creary , 66696@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169804428031083 (code B ref -1); Mon, 23 Oct 2023 06:58:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Oct 2023 06:58:00 +0000 Original-Received: from localhost ([127.0.0.1]:48917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quosy-00085H-4b for submit@debbugs.gnu.org; Mon, 23 Oct 2023 02:58:00 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:41668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quosu-000853-PW for submit@debbugs.gnu.org; Mon, 23 Oct 2023 02:57:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quosM-0007rJ-Bb for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 02:57:22 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quosD-00037f-JI for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 02:57:22 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5384975e34cso4503519a12.0 for ; Sun, 22 Oct 2023 23:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698044231; x=1698649031; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+Uf5qQwJy2IoD7veDkAEhvMHabsHvVnp5p4f3jcbxCE=; b=X1sf4k2WGIg5atWgoKnQ9LYr42Iihyd+qolav4OsZp/yTwEaWiSNzZ+NVE2D/GH7LS +uWguyaxaVdsgq1+sXUSv8bnK0wsDmDJoiAKwGS7cURldTuYrVcP3GIhWtU1PR3eycHS rPbNN+cZ1QwzeAtok2Thp2kUrMSb/mODutfNX8iFhCQneagQhGwwtC8wMplAnMmit4e3 B0O5Z10DnKsWA8Yuh8eobJxjDa9HAQTWpL90lvVw3Dc3fZmhXgnRGhZCOFj0khP/7QQM cQ2Fxv4vzCQiryqMpgruERYYhZcbUygkeFs3ogVjamxlwFGd0IhAaKs8Ue4BXqWfEzdD pwfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698044231; x=1698649031; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+Uf5qQwJy2IoD7veDkAEhvMHabsHvVnp5p4f3jcbxCE=; b=CRt68cD3kmDbYLgDuxNY98bSsPk3R12owHDhtPMnDVv4isvZBbFHYn6JPjs+KSJe8j 78ZvghHR3zTD70FlYRAxvcI8yeTVFN8XZ//9RuleawuKryV+4mluq4c7ZZqjqd1vdsxx b/FLq2GGsPKn1gDGIc3gPhBt1PJdzMoC/HdRlHdaCEPrOsciOjENqW3lcRMnn3X4+yC1 3lHv5KfgeD+7AfJc3jTOXMtF+vHEmXPRora7r/n9cmgRvWdJOxO4AfPPztlbWzf5EoQ8 v4F1TaV514Jv5Iuw8pgoYSG6hjZFC1s7Qf2y4DkxSGXeuzKpha1gweYI2tSBoBWMVA2z sKtg== X-Gm-Message-State: AOJu0Yw/Y/BnRosJ+szV0JX3nG20HmsS7RRkIrlg3t6QjcmOf/Z2fnLy 5MWQ+pH4Dej1jKzCq2a6tFdRckJrjn8= X-Google-Smtp-Source: AGHT+IEHa2XewLXULhWGKvBbVrbdzeCy/MVGy/2rcZvlBQjzzPfNMIfEbM8JlChmeJZktfyVuW7Org== X-Received: by 2002:a17:907:74a:b0:9a5:cf6f:3efc with SMTP id xc10-20020a170907074a00b009a5cf6f3efcmr5642597ejb.77.1698044231159; Sun, 22 Oct 2023 23:57:11 -0700 (PDT) Original-Received: from Pro.fritz.box (pd9e3686e.dip0.t-ipconnect.de. [217.227.104.110]) by smtp.gmail.com with ESMTPSA id c25-20020a170906695900b009ae3d711fd9sm6094914ejs.69.2023.10.22.23.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:57:10 -0700 (PDT) In-Reply-To: <1239664521.598080.1698039706916@mail.yahoo.com> (Lewis Creary via's message of "Mon, 23 Oct 2023 05:41:46 +0000 (UTC)") Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273008 Archived-At: Lewis Creary via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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) ))