[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lexical goto would include full continuations?
- From: Javier Guerra Giraldez <javier@...>
- Date: Tue, 12 Jul 2011 12:11:10 -0500
On Mon, Jul 11, 2011 at 9:34 PM, Charles Engelhard <ochuckles@gmail.com> wrote:
> function callcc(fun)
> local ret
> ::exit::
> if ret then
> return table.unpack(ret)
> else
> return fun(function(...)
> ret = {...}
> goto exit
> end)
> end
> end
that's _really_ eye-opening; but what i interpret of this is not that
"whe're so close to full continuations" instead, i think it means:
"fully lexical goto is just as hard to implement as continuations".
putting it way out of scope for current goals of 5.2.
maybe Lua 6.0 would have lexical goto, and implement continuations
over it, and coroutines on top of continuations; or maybe
continuations as primitive and goto as derivate.... or maybe some
other, more general mechanism that makes all this trivial to write. or
maybe we find that goto is actually a bad idea and eschew it totally.
--
Javier