On Thu, Dec 31, 2020 at 12:49 PM Massimiliano Gubinelli <[email protected]> wrote: > > Dear Bil, > > I've isolated what seems to be the problem in a test case: > > (let ((temp-value #f)) > (define *texmacs-module* (curlet)) > (define-macro (tm-define head . body) > `(begin > (set! temp-value ,@body) > (with-let *texmacs-module* > (define ,head temp-value)))) > (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)))) > > > This program takes ~35sec while a normal fib takes 3 sec on my machine. Any > idea why and how to solve this problem? >
In S7, "define-expansion" works more like "define-macro" other scheme implementations. I might oversimplify now, but define-macro expands during run-time, while define-expansion expands during compile-time. _______________________________________________ Cmdist mailing list [email protected] https://cm-mail.stanford.edu/mailman/listinfo/cmdist
