STYLE-WARNING when defining recursive cached functions
samebchase opened this issue · 2 comments
samebchase commented
PLAYGROUND> (function-cache:defcached factorial-rec (x)
(if (= x 0)
1
(* x (factorial-rec (1- x)))))
; in: DEFCACHED FACTORIAL-REC
; (FNCACHE.PLAYGROUND::FACTORIAL-REC (1- FNCACHE.PLAYGROUND::X))
;
; caught STYLE-WARNING:
; undefined function: FACTORIAL-REC
;
; compilation unit finished
; Undefined function:
; FACTORIAL-REC
; caught 1 STYLE-WARNING condition
FACTORIAL-REC
samebchase commented
In this line, we see that the memoization happens after the defun, whereas in cache.lisp, the caching is happening within the defun.
bobbysmith007 commented
Thanks so much for pointing this out, I appreciate you taking the time to contribute