Re: [racket] recursion style question

2014-09-06 Thread Marc Burns
As Greg explained, the named let form simplifies the interface to other code. It is much more common in practice. > On Sep 6, 2014, at 23:50, Greg Hendershott wrote: > > Well, I think you answer your own question with good reasons in the > last paragraph. :) > > If `acc` is an implementation d

Re: [racket] recursion style question

2014-09-06 Thread Greg Hendershott
Well, I think you answer your own question with good reasons in the last paragraph. :) If `acc` is an implementation detail, let's not expose it as a parameter.[1] At least, let's not do this for a function provided by a module. Especially not a function with a contract and/or documentation. But

[racket] recursion style question

2014-09-06 Thread Kevin Forchione
Hi guys, Which is preferable? (define (foo let … (acc empty)) … (foo (rest let) ... (cons …. acc)) or (define (foo lst ...) (let loop ([lst lst] …[acc empty]) … (loop (rest let) … (cons …. acc))) On the one hand we eliminate the named let construct, but on the other hand we expose the acc i