Subject: bug#66656: Bug reports

From: Stephen Berman <[email-masked]>
Date: Sat, 21 Oct 2023 00:06:55 +0200

On Fri, 20 Oct 2023 21:42:25 +0000 (UTC) Lewis Creary via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]> wrote:

[...]
> The main bug I'm reporting consists in the fact that recently, when I
> tried to test the lisp function displayed just below, I triggered the
> lisp error message "`let' bindings can have only one value-form", when
> it is clear from inspection of the let* form in question that no such
> bug exists.  The let* form in question does have just one value-form,
> the lisp variable eight-powr-sum..
>
> (defun octal-to-dec (n)
>   (let* ((oct-str {number-to-string n)
>          (octal-digits (string-to-reverse-numlist oct-str))
>          (oct-digit nil)
>          (eight-powr-term-val 0)
>          (eight-powr-sum 0)
>          (indx 0)
>          (while-nil-val (while (<= indx (length octal-digits))
>            (setq oct-digit (nth indx octal-digits)
>                  eight-powr-term-val (* oct-digit (expt 8 indx))
>                  eight-powr-sum (+ eight-powr-sum eight-powr-term-val)
>                  indx (1+ index) ))) ) ; end of let-variables
>      eight-powr-sum )))

The error is because the first let-binding binds `oct-str' to both
`{number-to-string' and `n'.  I guess `{' is a typo for `(' and there
should also be a closing `)': `(oct-str (number-to-string n))'.

Steve Berman