<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=""><div><blockquote type="cite" class=""><div class="">Am 08.01.2016 um 09:38 schrieb Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" 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="">I'd be hesitant to support something like this. • is a very natural choice for a binary operator by itself, and restricting it to require the use of spaces seems unfortunate.</div></div></blockquote><br class="">What about if • would have to begin and end an operator containing letters?<div class=""><br class=""></div><div class="">x = a •times• b •mod• 8</div><div class=""><br class=""></div><div class="">This looks more symmetrically (like Haskell’s backticks) and wouldn’t need the restriction to require spaces.</div><div class=""><br class=""></div><div class="">Or maybe</div><div class=""><br class=""></div><div class="">x = a ‹times› b ‹mod› 8</div><div class=""><br class=""></div><div class="">Also easily typeable on a Mac keyboard.<div><blockquote type="cite" class=""></blockquote></div></div><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" 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 class="">Re: free functions vs. methods: why does this matter? Supposing `foo` were the syntax (bad choice, because it already has another meaning, but bear with me), then you could disambiguate "a `foo` b" vs "a `self.foo` b" just as you can with regular function calls.</div></div></div></blockquote><div><br class=""></div>Indeed.</div><div><br class=""></div><div>-Thorsten</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div dir="ltr" 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 class="">Re: named parameters: there are two clear choices:</div><div class="">- Restrict such a syntax to functions without named parameters (seems acceptable to me).</div><div class="">- Ignore parameter names, allowing any binary function to be used (challenges with disambiguation, which I believe has had some discussion in the other thread about function names).</div><div class=""><br class=""></div><div class="">This might be a crazy idea, but is it possible to support "a myfunc b" without any extra delimiters? As far as I can tell, there's currently no way this could parse as a valid expression, so there's no ambiguity to resolve, although I imagine it would be hard to make diagnostics work well. I'm not sure how this would play with precedence, but that hasn't been discussed for any of the other solutions either.</div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob Bandes-Storch<br class=""></div></div></div></div><br class=""><div class="gmail_quote">On Fri, Jan 8, 2016 at 12:29 AM, Jo Albright via swift-evolution<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><span class=""><div class=""><blockquote type="cite" class=""><div class="">The rationale is the same - the design of Swift really wants operators and identifiers to be partitioned into different namespaces. Violating that would make it impossible to parse a swift file without parsing all of its imports. This is a mistake that C made (you have to parse all the headers a file uses to reliably parse the file) that we don’t want to replicate in Swift.</div></blockquote></div><div class=""><br class=""></div><div class=""><br class=""></div></span>Thanks Chris. I now understand the reasoning for separating the two groups. I don’t have a background in language creation, so whatever I can learn from these email lists is awesome. I have already gained a ton of knowledge following these conversations.<div class=""><span class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">Alternative: Reserve one of the operator characters as an operator introducer. Everything from that character to the next whitespace is an operator name. This would allow non-operator characters in operator names while still preserving the strict operator/identifier separation.<br class=""><br class=""> // • is the operator introducer character<br class=""> infix operator •times …<br class=""> infix operator •mod …<br class=""> x = a •times b •mod 8<br class=""><br class="">Limitations:<br class="">You still can't use an unadorned word as an operator name.<br class="">You can't use such an operator without whitespace (unlike operators whose names use operator characters only). </blockquote></div><div class=""><br class=""></div><div class=""><br class=""></div></span><div class="">Oooooo … that is a very cool alternative Greg. Honestly went into this proposal thinking there was no possibility, but now I have a glimmer of hope.</div><div class=""><br class=""></div><div class="">Using “•” (option + 8 on keyboard) would be great since it is accessible through key combo, but isn’t widely used in normal expressions.</div><div class=""><br class=""></div><div class="">What is needed to prove worth of such a feature to be added?</div><span class=""><div class=""><br class=""></div><div class=""><div class=""><br class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class=""><font color="#8d8d8d" class=""><span class=""> </span>Nerd . Designer . Developer</font></span><font color="#464646" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">Jo Albright</span></font><br class=""></div><br class=""></div></span></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=P-2BsYbBZHRBuLDBJaL4DIKDNfkkjpROowTyRAObV11qx-2FPIUYpQPl-2FpPBsPrAgcTRvn0wtVwSmRsU8e9zDesB6DitQzzJGzZMWaK8DuH-2FhcKd-2Bc4cKAi4f8c6jiZM9XcIJxraDuifdoDZjrxXzpoaiVyWPuJRkEPbub7J-2FiPpv3268IkAAC45TMPdXIocW8meBz3x2-2BrUY-2F1iODUKB9WRlYIH3dMFTxBlBqi6QeLmVdo-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class=""></blockquote></div><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1MXK54sosN3xru3iYcLt0oBZ2w20i49gyogXctgrspd2UyBFRJM4p1vqAvWjM5RbeCy26t4gBdqvQt0m5FYVK-2Bhn-2BYW29PEKSNglRotfag0KZCPcQDNyJuh4FylvOIv078WDdBqSgyGWuLfhmu1xeKAW4PuLvVEXBcH2kmBpDnwoYtz0G5-2FxrsWVW4-2B2aK-2F0LUbZtiTymvWaYcGNYSTf3XsH3-2FkYAnK2ODmDjOUdftE-3D" alt="" width="1" height="1" border="0" 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; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" 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=""><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="">swift-evolution mailing list</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=""><a href="mailto:swift-evolution@swift.org" 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="">swift-evolution@swift.org</a><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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></blockquote></div><br class=""></body></html>