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

Re: Issue: TAIL-RECURSION-OPTIMIZATION (Version 2)



    Date: Fri, 7 Oct 88  10:18:05 CDT
    From: David N Gray <Gray@DSG.csc.ti.com>

    In the case of a function that references itself,
    there can only be an inconsistency if the function is redefined during
    execution of the function, which is not very likely.

That's not true, because a function can't reference -itself-, it can
only reference -its name-.  For example,

(defun foo (x)
  (if (zerop x) 1 (* x (foo (1- x)))))
(setf (symbol-function 'bar) (symbol-function 'foo))
(defun foo (x)
  (* x 2))
(bar 3) => 12, not 6