Post by nelu
I think they were referring to the fact that the value of F(n) can be
calculated faster that to calculate all the values between F(0) and
F(n). Unfortunately, that's not what the question was.
Yep. And it's Rather Less Suboptimal to adapt an iterative or tail-
recursive single-value calculation to print all the preceding values as
well than to do the same with a closed-form calculation.
(I'd actually thought RH was referring to the suboptimality of an
iterative or recursive solution that only passes around one value at
a time. That would have been Rather Suboptimal.)
Post by nelu
I like your lisp code :-).
It wasn't lisp. Well, it might have been lisp, but it wasn't Lisp.
(At least, I don't think so.) If I'm not mistaken, Common Lisp puts
functions and ordinary values in different namespaces and gives you a hoop
to jump through to call a function through an ordinary name (as opposed
to through a name used to define a function), which Scheme doesn't.
For bonus points, what was the bug? (It's a fairly simple one, you
should be able to find it by careful inspection even if you don't know
the language, and it'll show up pretty obviously if you try to run it.)
(you really thought I'd post a bug-free homework solution, even in the
Dave Vandervies ***@csclub.uwaterloo.ca
Since we like to argue a lot on comp.lang.c figuring out who said what
and when is very important, so we can properly scoff at the right person.
--Daniel Fox in comp.lang.c