I'll answer anyway, because the `begin0` difference is subtle.
At the level of `let`, the Racket optimzier goes out of its way to not
convert your second program to the first. Continuation marks make a
change from non-tail call to tail call observable, and in this case,
the compiler won't be able
Actually nvm. Whoever wrote such macro could have just used `begin0`
instead.
On Monday, October 1, 2018 at 2:34:23 PM UTC-4, Phil Nguyen wrote:
>
> (Racket 7.0) This program runs in no time:
>
> (define (sum n acc)
> (if (> n 0)
> (sum (- n 1) (+ acc n))
> acc))
>
> (collect-garbag
2 matches
Mail list logo