On Mar 24, 4:58 pm, Raffael Cavallaro <················@gmail.com>
wrote:
> On Mar 24, 4:25 pm, Tim Bradshaw <··········@tfeb.org> wrote:
>
> > I believe (from what is now reasonably distant memory of CL) that
> > suitable NOTINLINE declarations can help you.
>
> Right you are. Simply changing fib's definintion to:
>
> (defun fib (n)
> (declare (notinline fib))
> (if (<= n 1) n
> (+ (fib (- n 1)) (fib (- n 2)))))
>
> fixes the problem in ecl
Just to clarify, the behavior the op saw in ecl is *not* a bug in ecl.
It is perfectly permissible for an implementation to call a function
object directly rather than go through the symbol unless that function
is declared notinline.