At 04:08 PM 12/31/2001 +0100, Benoit Cerrina wrote:
> >
> > If you only allow yeilding from the outermost level of scope in a routine,
> > you can do evil things with Duff's Device. Which is what Python does. (But
> > it's sufficient for most purposes)
> >
> > Dan
> >
>Duff's device being evil enough in and out of itself I'm not sure I see what
>this
>has to do with yielding, it also only applies to c and c++...
>I think you mean break is a kind of yield but this is not the same.  Can you
>explain.

The details are in the archives for the LL1 list. (Off of ll1.mit.edu 
somewhere) Basically python fakes it under the hood and uses duff's as a 
dispatch method to the yielded spot. I didn't dig into it much--it was a 
clever hack, but insufficient in the general case.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to