Re: [racket-users] Re: Surprising slow-down of near tail-call: Potential missed optimization?

2018-10-01 Thread Matthew Flatt
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

[racket-users] Re: Surprising slow-down of near tail-call: Potential missed optimization?

2018-10-01 Thread Phil Nguyen
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