Re: How would shallow generators compose with lambda?

2009-05-28 Thread Brendan Eich
On May 14, 2009, at 2:10 PM, Mark S. Miller wrote: On Thu, May 14, 2009 at 1:22 PM, Brendan Eich bren...@mozilla.com wrote: On May 14, 2009, at 12:24 PM, Jason Orendorff wrote: 3. When a lambda yields, [...] there may be other functions on the stack, in between. You can't always statically

Re: How would shallow generators compose with lambda?

2009-05-28 Thread David-Sarah Hopwood
Brendan Eich wrote: I think we missed an alternative that comports with Tennent's Oversold Correspondence Principle, *and* composes. Thanks to Dave Herman for pointing it out. function gen(x) { foo( lambda (x) (yield x*x) ); } need not yield from gen if the lambda is called from foo

Re: How would shallow generators compose with lambda?

2009-05-28 Thread Brendan Eich
On May 28, 2009, at 11:48 AM, Jim Blandy wrote: This is just a desugaring of some nested lets, but we still have yield capturing many frames. If this doesn't work, lambda is really useless. Dave replied, but I wanted to join in agreeing on the following: For what it's worth, speaking as