Generator issue: exceptions while initializing arguments
Kevin Smith
khs4473 at gmail.com
Fri Sep 14 05:46:22 PDT 2012
>
> I don’t have a strong preference. It seems to be is a classic Right
> Thing vs. Worse Is Better situation. The advantage of the Worse Is
> Better approach is that you can correctly and completely explain
> what’s going on in one sentence: “It’s just like an if statement at
> the top of the function body.” It may not be reasonable, but ordinary
> developers can reason about it. When it comes to corner cases, which
> is more important?
>
Apologies for not making this clear earlier, but I agree with the "Worse is
Better" approach. That is, execute defaults in the scope of the function
body. When I tried to formulate the scope boundaries (as you have) it
became clear to me that it would be convoluted any other way.
What I'm questioning now is the idea that, in generators, the implicit
first yield should occur *before the defaults are evaluated*. I don't
think that's a tenable position. Is there an implementation problem with
inserting the implicit first yield *after* the defaults are evaluated but
*before* the rest of the function body?
Thanks for your time on this, BTW.
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120914/39bde0aa/attachment.html>
More information about the es-discuss
mailing list