[CM] Performance of S7
bil at ccrma.Stanford.EDU
bil at ccrma.Stanford.EDU
Thu Dec 31 06:13:58 PST 2020
I think the problem here is with-let -- it is blocking
the normal optimizations that would otherwise speed
up fib. Here is an ugly substitute:
(let ((temp-value #f))
(define *texmacs-module* (curlet))
(define-macro (tm-define head . body)
`(eval (list 'define ',head ', at body) *texmacs-module*))
(let ()
(tm-define fib (lambda (n) (if (< n 2) n (+ (fib (- n 1)) (fib
(- n 2)))))))
(let ((n 40))
(format *stdout* "(fib ~A) : ~A \n" n (fib n))))
There has to be a prettier way to do it!
with-let should not be so paranoid...
More information about the Cmdist
mailing list