From: Raffael Cavallaro
Subject: Re: Memoization issues
Date: 
Message-ID: <89d7e864-06eb-4e8f-8b0b-7c3a65738dd0@p11g2000yqe.googlegroups.com>
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.