[Ecls-list] memoize compiled function

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Mon Mar 29 09:04:36 UTC 2010


On Mon, Mar 29, 2010 at 10:36 AM, Alessandro Serra <gas.hale at gmail.com>wrote:

> Hi all,
> I was playing with "memoize" when I found out that I cannot do it with
> recursive compiled functions. A recursive function is usually compiled
> as:[...]
> > (setf (symbol-function 'f) ...)
>  has not effect on the recursive calls of f.
> I'm not an expert of common lisp standard. I would like to know if the
> ecl's behaviour is correct.
>

Yes, it is. Compiled functions in can use direct references to the code they
want to invoke, instead of going through the symbol. Just add (declare
(notinline f)) to the top of the function code.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://tream.dreamhosters.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100329/bfb2368c/attachment.html>


More information about the ecl-devel mailing list