[plt-scheme] Re: a few questions
On Dec 4, 2005, at 3:10 PM, Jens Axel Søgaard wrote:
> You forgot a parenthesis before the lambda in the lp-clause:
>
> (define fact
> (lambda (n)
> (letrec ([l1 (lambda (m ans)
> (lp n 1))]
> [lp (lambda (m ans)
> (if (= m 0) ans
> (l2 m ans)))]
> [l2 (lambda (m ans)
> (lp (- m 1) (* m ans)))])
> (l1 '() '()))))
>
> (Note: [] and () mean the same)
>
Thanks (and thanks to everyone else who replied. I messed myself up
trying to omit the RETURN, I think.) Anyway, this works perfectly.
===
Gregory Woodhouse
gregory.woodhouse at sbcglobal.net
"It is foolish to answer a question that
you do not understand."
--G. Polya ("How to Solve It")