<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Bil,<div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 31. Dec 2020, at 15:13, <a href="mailto:bil@ccrma.stanford.edu" class="">bil@ccrma.stanford.edu</a> &lt;<a href="mailto:bil@ccrma.Stanford.EDU" class="">bil@ccrma.Stanford.EDU</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I think the problem here is with-let -- it is blocking<br class="">the normal optimizations that would otherwise speed<br class="">up fib. &nbsp;Here is an ugly substitute:<br class=""><br class="">(let ((temp-value #f))<br class=""> &nbsp;&nbsp;&nbsp;(define *texmacs-module* (curlet))<br class=""> &nbsp;&nbsp;&nbsp;(define-macro (tm-define head . body)<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`(eval (list 'define ',head ',@body) *texmacs-module*))<br class=""><br class=""> &nbsp;&nbsp;&nbsp;(let ()<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(tm-define fib (lambda (n) (if (&lt; n 2) n (+ (fib (- n 1)) (fib (- n 2)))))))<br class=""><br class=""> &nbsp;&nbsp;&nbsp;(let ((n 40))<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(format *stdout* "(fib ~A) : ~A \n" n (fib n))))<br class=""><br class="">There has to be a prettier way to do it!<br class=""><br class="">with-let should not be so paranoid...<br class=""><br class=""></div></div></blockquote><br class=""></div><div><div class="">&nbsp;thanks, indeed it works for the small example. However the *real thing* still run as slow as before even with this replacement.</div><div class=""><br class=""></div><div class="">I've extracted the "real" tm-define and I attach a test case which indeed still show the slowness even using the "eval" trick.</div><div class=""><br class=""></div><div class="">I hope there is something to do about it. Even a trick would do, this is the only point in all the sources where I do some trickery with lets.<br class=""><div><br class=""></div><div>Max</div><div><br class=""></div><div></div></div></div></div></body></html>