|
Thursday, May 06, 2004 |
A summary of Avi Bryants Seaside talk.
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.
|
|
|