Escaping continuations in common lisp?

  • Follow


I wrote a small tutorial about delimited continuations in common lisp
http://tourdelisp.blogspot.com/2007/12/delimited-continuations-with-cl-cont.html
usin cl-cont http://common-lisp.net/project/cl-cont/  ,  weblocks
http://common-lisp.net/project/cl-weblocks/ code walker  and I plan to
wrote a second part with something more complex like coroutines
and ... still looking for ideas.  Proposals are wellcome. So I have a
question is it possible to implement escaping continuations  like in
scheme, using delimited ones?
Quick example:
Multiplying numbers in a list using continuations,  and as soon as
zero is encountered in the list, the continuation should escape and
return zero.
[shamelessly ripped from teach yourself scheme in fixnum days]

thanks
Slobodan
0
Reply slobodan.blazeski (1459) 12/6/2007 7:02:29 PM

On Dec 7, 8:02 am, Slobodan Blazeski <slobodan.blaze...@gmail.com>
wrote:
> I wrote a small tutorial about delimited continuations in common lisphttp://tourdelisp.blogspot.com/2007/12/delimited-continuations-with-c...
> usin cl-conthttp://common-lisp.net/project/cl-cont/ ,  weblockshttp://common-lisp.net/project/cl-weblocks/code walker  and I


Hi Slobodan,

Quick question: what is the difference between cl-cont
and arnesi's call/cc?

0
Reply senatorZergling (101) 12/7/2007 11:35:02 AM


On Dec 7, 12:35 pm, szergling <senatorZergl...@gmail.com> wrote:
> On Dec 7, 8:02 am, Slobodan Blazeski <slobodan.blaze...@gmail.com>
> wrote:
>
> > I wrote a small tutorial about delimited continuations in common lisphttp://tourdelisp.blogspot.com/2007/12/delimited-continuations-with-c...
> > usin cl-conthttp://common-lisp.net/project/cl-cont/,  weblockshttp://common-lisp.net/project/cl-weblocks/codewalker  and I
>
> Hi Slobodan,
>
> Quick question: what is the difference between cl-cont
> and arnesi's call/cc?

I never tried arnesi but according to discussion I had with Slava the
author of cl-cont and weblocks:
Quote:
>CL-CONT does a compile time transformation while ARNESI/CC uses an
>interpreter for a subset of Common Lisp. The approaches are slightly
>different. However, you can use ARNESI/CC instead of CL-CONT with
>Weblocks with very minor modifications (they use KALL to restore
>continuations, while CL-CONT allows you to just use FUNCALL).

You can read the full discussion at
http://groups.google.com/group/weblocks/browse_thread/thread/901120a5eb67ebbb/b4fdd3f4639a0892?lnk=gst&q=cl-cont#b4fdd3f4639a0892

cheers

Slobodan
0
Reply slobodan.blazeski (1459) 12/7/2007 11:59:30 AM

2 Replies
58 Views

(page loaded in 0.07 seconds)


Reply: