[Python-Dev] Anonymous blocks: Thunks or iterators?

Aahz aahz at pythoncraft.com
Fri Apr 29 18:34:08 CEST 2005


On Thu, Apr 28, 2005, Brian Sabbey wrote:
> 
> It is possible to implement thunks without them creating their own frame. 
> They can reuse the frame of the surrounding function.  So a new frame does 
> not need to be created when the thunk is called, and, much like with a 
> yield statement, the frame is not taken down when the thunk completes 
> running.  The implementation just needs to take care to save and restore 
> members of the frame that get clobbered when the thunk is running.
> 
> Cells would of course not be required if the thunk does not create its own 
> frame.

Maybe.  It's not clear whether your thunks are lexical (I haven't been
following the discussion closely).  If it's not lexical, how do locals
get handled without cells?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It's 106 miles to Chicago.  We have a full tank of gas, a half-pack of
cigarettes, it's dark, and we're wearing sunglasses."  "Hit it."


More information about the Python-Dev mailing list