Only memoize pure functions for programs

The problem with doing this for libraries is that it adds a new dependency on (srfi 69). It would be problematic to use a library with these changes as there is no easy way to know this SRFI is also a library dependency.
This commit is contained in:
Justin Ethier 2019-02-14 22:53:12 -05:00
parent ae768b0e83
commit d0d7fae89c

View file

@ -461,7 +461,9 @@
(define (flag-set? flag)
(cond
((eq? flag 'memoize-pure-functions) *optimize:memoize-pure-functions*)
((eq? flag 'memoize-pure-functions)
(and program? ;; Only for programs, because SRFI 69 becomes a new dep
*optimize:memoize-pure-functions*))
(else #f)))
(when (> *optimization-level* 0)