callcc

I just don't get continuations!

What are they and what are they good for? I do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner? ...

Working with Seaside continuations

How do I get a BlockClosure in Squeak (I want to use BlockClosure>>callCC)? When I write [#foo] that is a BlockContext, what's the deal? Update: I have worked out that BlockClosure is a thing mainly of new compiler. Instead how do I work with seaside Continuations? I'm having problems, and any examples would be appreciated. Further u...

Java: using a RuntimeException to escape from a Visitor

I am being powerfully tempted to use an unchecked exception as a short-circuit control-flow construct in a Java program. I hope somebody here can advise me on a better, cleaner way to handle this problem. The idea is that I want to cut short the recursive exploration of sub-trees by a visitor without having to check a "stop" flag in eve...

What is call/cc?

I've tried several times to grasp the concept of continuations and call/cc. Every single attempt was a failure. Can somebody please explain me these concepts, ideally with more realistic examples than these on Wikipedia or in other SO posts. I have background in web programming and OOP. I also understand 6502 assembly and had a minor ra...

Specifics of call/cc

This is related to http://stackoverflow.com/questions/612761/what-is-call-cc, but I didn't want to hijack this question for my own purposes, and some of its arguments like the analogy to setjmp/longjmp evade me. I think I have a sufficient idea about what a continuation is, I think of it as a snapshot of the current call stack. I don't ...

Is it possible to do a call-cc in go-language? (go-lang.org)

Is it possible to do a call-cc (http://en.wikipedia.org/wiki/Call-with-current-continuation) in Google's new Language Go? (http://golang.org/) ...

How the yin-yang puzzle works?

I'm trying to grasp the semantics of call/cc in Scheme, and the Wikipedia page on continuations shows the yin-yang puzzle as an example: (let* ((yin ((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c)))) (yang ((lambda (cc) (display #\*) cc) (call-with-current-continuation (lambda (c) ...

Continuation (call/cc) in Scheme

Hi All, I need to understand Continuations in Scheme for my upcoming exams and I have no idea about continuations at all. Can anyone please suggest me sources of how to go about learning continuations? Regards, darkie ...

call/cc in Lua - Possible?

The Wikipedia article on Continuation says: "In any language which supports closures, it is possible to write programs in continuation passing style and manually implement call/cc." Either that is true and I need to know how to do it or it is not true and that statement needs to be corrected. If this is true, please show me how to implem...

How does this callcc example work?

(callcc (fun k -> k 7)) + 3 (callcc (fun k -> 7)) + 3 What do each of these evaluate to and why? ...

How to make just part of a macro hygienic

I'd like to have a version of lambda, called lambda-r, from within which you can return. An example: (+ ((lambda-r () (return 1) 2)) 5) This would give the value 6. Although you might expect the value to be 7, it's 6 because 1 is returned from the lambda-expression before 2 is reached. Here's an example of the kind of transfo...

Can call-with-current-continuation be implemented only with lambdas and closures?

Does anyone know if call/cc can be implemented with just lambdas and closures? It seems that call/cc interrupts the program's flow (like an exception) but lambdas and closures can't do that. Therefore I think call/cc can't be implemented via lambdas and closures. Any more ideas? ...