<div dir="ltr">On Sun, May 12, 2013 at 5:30 PM, Martin Morrison <span dir="ltr"><<a href="mailto:mm@ensoft.co.uk" target="_blank">mm@ensoft.co.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><span></span></div><div>Moving past the outright negative feedback, and having only just seen the PEP, the proposed syntax did strike me as awkward and unintuitive. Maybe there is some explanation for why decorator-like syntax was used - if so, please do link me so I can read up.</div>
</div></blockquote><div><br></div><div>I just read PEP 403 myself also.  I confess I likewise have trouble getting past the unnatural feeling (to me, at least at first brush) of the decorator syntax.  The rejected alternative of the 'given' keyword seems less unnatural.<br>
<br></div><div>I wonder though why not just use the ML style here.  E.g. Spell this:<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto"><div>in x = do_something(in_arg, success_hdlr, error_hdlr):<div>    def success_hdlr(result):</div><div>        ... # Do something with result</div><div>    def error_hdlr(error):</div><div>        ... # Do something with error</div>
</div></div></blockquote><div><br></div><div>As:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>in x = do_something(in_arg, success_hdlr, error_hdlr, const) let:<br>
<div>    def success_hdlr(result):</div><div>        ... # Do something with result</div><div>    def error_hdlr(error):</div><div>        ... # Do something with error<br></div><div>    const = 42<br></div></div></div></blockquote>
<div><br></div><div>Well, I've reversed the order of in/let from ML, but the keywords are the same.  But as Martin points out, I can't see any reason to preclude defining multiple one-off blocks... not even if the name definitions aren't 'def' or 'class' (hence my addition of defining 'const=42' in my slightly expanded version). <br>
<br></div><div>Yes it's still a pseudo-block, and we do have to do something with scoping.  But it reads better to me than 'given', and also better than the bare 'in' block introduction without the explicit 'let'.<br>
</div><br></div></div>Yours, David...<br clear="all"></div><div class="gmail_extra"><br>-- <br>Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>
uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons.  Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br>
</div></div>