[prev in list] [next in list] [prev in thread] [next in thread]
List: lua-l
Subject: Re: More on environments and objects
From: Mark Hamburg <mhamburg () adobe ! com>
Date: 2005-08-28 17:25:12
Message-ID: BF374188.39883%mhamburg () adobe ! com
[Download RAW message or body]
on 8/27/05 8:04 AM, Rici Lake at lua@ricilake.net wrote:
>> - Yield from everywhere.
>
> I'm starting to think that yield is hiding an ambiguity. The fact that
> you cannot use yield to both implement control-inversion and
> thread-scheduling independently makes me wonder if there isn't some
> better way.
At the very least, it takes some careful programming with a special value
meaning "yield-back-to-the-scheduler" and a version of resume that knows to
look for this value. At the same time, one might also implement a version of
yield for the back-to-the-scheduler case that would throw an error rather
than returning if so signaled.
Like call/cc, Lua's coroutine operations are good primitives, but they can
still take some work to make do what you want. They are easier to think
about and a lot closer to being generally useful than call/cc, however.
Mark
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic