lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> steve donovan <steve.j.donovan@gmail.com> writes:
> 
> > On Tue, Feb 22, 2011 at 3:09 PM, Gunnar Zötl <gz@tset.de> wrote:
> >> Anyways, call/cc would be so brilliant :)
> >
> > I've tried to understand Scheme continuations, but so far this brain
> > has refused to make the jump.
> 
> Well, you presumably know the normal call/return mechanism in connection
> ...

nice explanation :) In simpler terms (that I would unterstand ;) ): call/cc wraps the remainder of your current function into a function, and passes that as an argument to a function it calls.

> call/cc may be brilliant, but it is basically only used as a low-level
> tool for implementing more understandable constructs.

Yup, that it is. Back in my scheme days I used it for example to implement coroutines or state machines, and much of what you can to with continuations can also be achieved with luas coroutines. They're just a broader concept. As an everyday programming tool continuations are just too confusing :)

Just to be clear on that, I do think continuations would suit lua rather well, but I don't actually need them. Nor would I petition to have them implemented.

Gunnar