Continuations - part 1.
Ok, so why did I write a post on last-call-optimisation? Well I find it very difficult to explain continuations to someone who dosn't understand LCO, so I thought I should post a quick example of LCO before this. Of course the reason behind this sudden urge to actually fulfil my promise to explain continuations here is Lambda again. This time an extended discussion on continuations sparked by Keith Devens' request for help understanding the things. Itself sparked by a particularly interesting analogy by Luke Palmer in news:perl.perl6.language, now forever dubbed the "Continuation Sandwich" --- the relevant part of his post is:
Say you're in the kitchen in front of the refrigerator, thinking about a sandwitch. You take a continuation right there and stick it in your pocket. Then you get some turkey and bread out of the refrigerator and make yourself a sandwitch, which is now sitting on the counter. You invoke the continuation in your pocket, and you find yourself standing in front of the refrigerator again, thinking about a sandwitch. But fortunately, there's a sandwitch on the counter, and all the materials used to make it are gone. So you eat it. :-)
Now before we begin I'm going to deal with continuation-passing-style and call-with-current-continuation seperately, but as a taste of what we're in for interested parties can check my CPS-in-Java example on the haskell.org wiki, or the most lucid description of call/cc in Chapter 13 of Teach Yourself Scheme in Fixnum Days.
In the meantime, it's 0021 hours here, so I'm going to sleep first, and finish this later.



8 Comments:
Hi, I was searching blogs and came onto your fantastic blog.
I have a niche site. It pretty much covers how make money with optimizing your image alt attribute
marketing.
Keep it up. I'll check back later, I'm sure.
By
Anonymous, at 3:09 PM, October 11, 2005
This site is great, nice job!!
I have a SEO info site. It is about advice seo spain articles and stuff.
Drop by when you can, nice site here!
By
Anonymous, at 8:42 AM, October 13, 2005
I discuss this topic daily myself. I also have a website that talks about adwords google professional related things. Go check it out if you get a chance.
By
Anonymous, at 7:51 PM, October 30, 2005
nice blog enjoyed it :)
Keep up the excellent work! and i bookmarked u!
so cant wait for ur next post! :)
Thanks!!
By
Anonymous, at 2:21 PM, November 01, 2005
Enjoyed your blog - thanks for sharing. I also have a website about affordable web site promotion If you have time, check out my site. Thanks for taking the time to share your blog.
By
HTML-Magazin, at 8:26 AM, November 08, 2005
While surffing I came across your blog. I have software sales site that has a lot of products related to
hosting prestonswebhosting.com promotion site web web web A lot of people whos purchase scripts or software having to deal with hosting prestonswebhosting.com promotion site web web web ask for more information and I will definatly tell them to check out your site. Do keep up the great work!
By
Anonymous, at 9:30 AM, November 21, 2005
In order to succeed online one needs two things - a killer web site and a steady stream of potential customers. Get both at www.TheOnlinePromoters.com
By
Slipper, at 4:50 PM, December 08, 2005
we offer wow power leveling and wow gold wow gold
By
reyt, at 12:03 PM, July 15, 2009
Post a Comment
<< Home