lua-users home
lua-l archive

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


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