Updated: 11/5/2005; 6:05:59 PM.
Chris Double's Radio Weblog
        

Thursday, May 06, 2004

A summary of Avi Bryants Seaside talk (no longer available). In the summary there is a section about 'ensure' and how it works in the presence of continuations. It mentions that 'Scheme has continuations. Common Lisp has no continuations because it has ensure'.

Scheme has a form of 'ensure'. It is called 'dynamic-wind' and allows code to be executed before entry and after exit of the dynamic-wind block. It works in the presence of continuations in that whenever the code block is 're-entered' by a continuation the 'entry' block is executed again, and the 'exit' block executed on leaving the code block (whether leaving naturally or via escaping through a continuation).

Kent Pitman has an article on 'UNWIND-PROTECT vs Continuations'. UNWIND-PROTECT is the Common Lisp equivalent of dynamic-wind. It allows a section of code to be executed whenever a block is exited. In that article Kent points out that dynamic-wind really solves a different problem than UNWIND-PROTECT and explains why you cannot implement the latter in the prescence of continuations easily.

Dorai Sitaram wrote a paper 'Unwind-protect in portable Scheme' that outlines some ways that you can write UNWIND-PROTECT.


10:39:20 AM      

From naseby+ruby+stuff: A language that targets the .NET CLR, Nemerle. It has macros, pattern matching, static and on-demand typing, type inference and functional features.

10:22:08 AM      

© Copyright 2005 Chris Double.
 
May 2004
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Apr   Jun


Smalltalk with Rants
Pitcairn News

Click here to visit the Radio UserLand website.

Click to see the XML version of this web page.