January 2018

S M T W T F S
  123456
78910111213
14151617181920
21222324252627
28293031   

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Monday, September 3rd, 2007 12:41 am
I have a question for the CS types out there: what exactly is the point of tail-call elimination?

Before you go into great detail about stack overflows, rest assured that I understand that bit. But why is tail-recursive code considered such a good thing? I mean, you write your code in a non-obvious way so that the optimiser can turn it into the loop that you meant to write in the first place. Why not just write the loop yourself? It has the same effect, expresses your intent more clearly, and doesn't require the mental gymnastics to make your code tail-recursive, or to decode it when reading.

I can see why you need it if you're determined to make your language stateless (though actually, that's a related question: how is recursive code with accumulators any safer than iterative code with local state?), but why is it needed in languages like Lisp, which already have perfectly good looping constructs?

Don't get me wrong: recursion is clearly a Good Thing. But all the really interesting uses of recursion, it seems to me, are things like recursion on trees or other data structures, which are not in general tail-recursive.

In other hacking news, I spent much of my evening making a set of spice racks out of chopsticks, duct tape and strawberry boxes. My kitchen is now a fraction tidier.
(Anonymous)
Tuesday, September 20th, 2011 12:47 am (UTC)
[url=http://pharmacyshop-online.com]buy generic viagra no prescription[/url] We embezzle the sanctuary of our customers really and wise we induce sound steps to shield your information. After submitting the unsuitable you are redirected to the cosy order page. The guaranty of the page can be without even trying checked: an icon resembling a padlock is displayed on the basis of most browsers window, this shows that the poop you tip-in into the pattern is SSL (Shut Socket Layer) encrypted when transmitted to our attribution anniversary card processing company. Please remember that a hypothecate errand-boy begins with "https:" while unguarded ones on with "http:" without the "s" at the end. [url=http://pharmacyshop-online.com]viagra 20mg online[/url]