Do not attempt to memoize functions that take 0 args

This commit is contained in:
Justin Ethier 2019-02-15 12:36:54 -05:00
parent 7021855eca
commit fa01202df8
2 changed files with 2 additions and 1 deletions

View file

@ -450,7 +450,7 @@
(set! globals (append globals '(Cyc-memoize))) (set! globals (append globals '(Cyc-memoize)))
(set! imported-vars (cons (lib:list->import-set '(Cyc-memoize srfi 69)) imported-vars)) (set! imported-vars (cons (lib:list->import-set '(Cyc-memoize srfi 69)) imported-vars))
) )
TODO: this blows up compiling the tail-call-opt example program...
(inject-import '(scheme cyclone common)) (inject-import '(scheme cyclone common))
(inject-import '(scheme base)) (inject-import '(scheme base))
(inject-import '(scheme char)) (inject-import '(scheme char))

View file

@ -107,6 +107,7 @@
(ref? var) (ref? var)
(ast:lambda? body) (ast:lambda? body)
(eq? (ast:lambda-formals-type body) 'args:fixed) (eq? (ast:lambda-formals-type body) 'args:fixed)
(> (length (ast:lambda-args body)) 1) ;; Need some args other than the cont
(< (length (ast:lambda-args body)) 4) ;; Too many combinations w/more args (< (length (ast:lambda-args body)) 4) ;; Too many combinations w/more args
(adb:get/default var #f) (adb:get/default var #f)
(adbv:self-rec-call? (adb:get/default var #f)) (adbv:self-rec-call? (adb:get/default var #f))