bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49647: 27.2; Reference Manual sec. 10.2.4; Incorrect example for ind


From: Michael Heerdegen
Subject: bug#49647: 27.2; Reference Manual sec. 10.2.4; Incorrect example for indirect-function
Date: Tue, 20 Jul 2021 01:59:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Scott Marks <scott.c.marks@gmail.com> writes:

> If one copies the example:

You mean from the manual, (info "(elisp) Function Indirection") I think.

>  Here is how you could define indirect-function in Lisp:
>
>  (defun indirect-function (function)
>
>    (if (symbolp function)
>
>        (indirect-function (symbol-function function))
>
>      function))
>
> this code will throw due to infinite recursion when invoked as
>
> (indirect-function nil)
>
> The fix is obvious: wrap (symbolp function) with (and function ...)

In my opinion your analysis is correct and the fix is good.

I leave it to the second reader to make the change.


Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]