Re: newbie exploring better ways
- From: K Livingston <kevinlivingston.public@xxxxxxxxx>
- Date: Wed, 30 Jan 2008 10:35:25 -0800 (PST)
On Jan 30, 5:16 am, Maciej Katafiasz <mathr...@xxxxxxxxx> wrote:
This is absolutely untrue. TCO is not mandated by the language standard,.. snip ..
therefore relying on it is like writing code that depended on certain
variables being elided by the compiler in optimisation phase. It's been
discussed many times here; TCO is not just something you drop into your
code and merrily go your way, it depends on any number of factors and
It's okay to present a recursive solution for its conceptual elegance,
but it's utterly and completely wrong to present it without appropriate
disclaimers about inherent limitations, or claim that these limitations
are just a matter of using a better compiler. They're not.
That's a very good point. While the CL compiler I use daily (Allegro)
does it (I use CLISP periodically and thought it does it, I thought
most do, I could be very wrong), regardless I have probably grown to
count on it a little more than I should - as you are right it's not
something that is guaranteed or specified. When available though, I'm
going to use all the tools in my box.
And then, if it doesn't, or it's slow, when I profile it, I will see
that. If I can write a simple 3 line tail recursive version (when the
others seem longer or more difficult to conceive), I'm probably going
to write it, because it's fast to write and easy to maintain. If the
profiler says it is (too) slow, I'll change it when, and if, it's a
problem.
Thanks for not letting me reinforce only part of the story.
.
- Follow-Ups:
- Re: newbie exploring better ways
- From: vijay
- Re: newbie exploring better ways
- References:
- newbie exploring better ways
- From: vijay
- Re: newbie exploring better ways
- From: Griff
- Re: newbie exploring better ways
- From: Kent M Pitman
- Re: newbie exploring better ways
- From: K Livingston
- Re: newbie exploring better ways
- From: Maciej Katafiasz
- newbie exploring better ways
- Prev by Date: Re: Paul Graham's Arc is released today... what is the long term impact?
- Next by Date: Re: better way to enumerate
- Previous by thread: Re: newbie exploring better ways
- Next by thread: Re: newbie exploring better ways
- Index(es):
Relevant Pages
|