<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 1, 2017, at 2:17 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Mar 1, 2017, at 11:46 AM, Matthew Johnson <<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>> wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">I agree that the ambiguity created by moving `let` outside the local =<br class="">binding context is problematic. I alway place `let` immediately =<br class="">alongside the binding for this reason. =20<br class=""><br class="">In design 2 do you disallow matching a value using an existing name? If =<br class="">so, how do users match values bound to an existing name? Or is that =<br class="">just not possible? I would oppose design 2 if it=E2=80=99s not =<br class="">possible.<br class=""></blockquote><br class="">It shadows, just like it currently does<br class=""></blockquote><br class="">In that case I oppose design 2. If we're going to change this let's fix it and remove the ambiguity (from a reader's perspective when they don't know the rule).<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I don't mind dropping design 2. It was added to the conversation just as we stopped<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">discussing this the first time. Was trying to pick up with all the conversation intact.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">Both syntax designs you propose are very concise, but they look like an =<br class="">operator which can take any value with the appropriate type on the left =<br class="">hand side. Unfortunately this isn=E2=80=99t the case (haha). I think =<br class="">that is problematic. Did you consider this? If so, what is the =<br class="">rationale for this choice?<br class=""><br class="">For example, a user might expect to be able to say:<br class=""><br class="">// match is a boolean that is true if the pattern matched and fast =<br class="">otherwise<br class="">let match =3D .success(let value) ~=3D result<br class=""><br class="">// we don=E2=80=99t know if `value` is bound here so we cannot allow the =<br class="">above to be valid code.<br class=""></blockquote><br class="">Swift doesn't allow the results of conditional binding to be used as straightforward<span class="Apple-converted-space"> </span><br class="">Booleans as they must be bound into a scope. `guard` cheats.<br class=""></blockquote><br class="">I understand that. What I'm saying is that I can't think of any other binary operator in Swift whose result cannot be assigned to a name. For that reason I am not convinced we should adopt the syntax you propose. This *is not* a normal binary operator expression so it shouldn't look like one.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">How are you with design 1, my original design?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>It has the same syntactic issue. In fact, the issue is worse in design 1 because the `~=` operator is already a valid binary operator that can be used in normal expressions. Introducing a special syntactic context where it has additional capabilities feels problematic to me. I wish that wasn’t the case because I generally like the direction, but this seems like a pretty important consideration.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><br class="">-- E<br class=""><br class=""><br class=""><blockquote type="cite" class=""><br class="">href=3D"<a href="mailto:swift-evolution@swift.org" class="">mailto:swift-evolution@swift.org</a>" =<br class="">class=3D""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></a><br =<br class="">class=3D""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br =<br class="">class=3D""></div></blockquote></div><br =<br class="">class=3D""></div></div></div></body></html>=<br class=""><br class="">--Apple-Mail=_99FCC835-0665-499E-84F7-EB04BAEF8812--</blockquote></blockquote></blockquote></div></blockquote></div><br class=""></body></html>