<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, May 2, 2016 at 1:56 PM Dave Abrahams <<a href="mailto:dabrahams@apple.com">dabrahams@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
on Mon May 02 2016, Tony Allevato <allevato-AT-google.com> wrote:<br>
<br>
> On Mon, May 2, 2016 at 1:20 PM Dave Abrahams via swift-evolution<br>
> <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
><br>> How does one distinguish between calls to a static prefix operator and a<br>
> static postfix operator with the same name?<br>
><br>
> Ah, that's a tricky one that I don't have an immediate answer to, so I'm<br>
> definitely open to creative thoughts here.<br>
<br>
One possibility: just use “qualified operator” notation.<br>
<br>
lhs T.+= rhs<br>
<br>
T.++x<br>
x T.++<br></blockquote><div><br></div><div>Even though this seemed a little odd when you first suggested it in the other thread, it's growing on me now that we have to deal with this ambiguity.</div><div><br></div><div>Fortunately the only situation I foresee where a person would explicitly use this notation would be in the trampoline operator, so even if it looks a little odd, at least it's isolated.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> The first stab I would take at is, what if we included the token "prefix" or<br>
> "suffix" before the operator name in the expression, like this?<br>
><br>
> return T.prefix ++(&value)<br>
> return T.postfix ++(&value)<br>
><br>
> But that could start to look like an invocation of "++" on a static property<br>
> "T.prefix". I haven't dug into the parser to determine if that would even be<br>
> feasible or not.<br>
<br>
These are not unreasonable either:<br>
<br>
return prefix T.++(&value)<br>
return postfix T.++(&value)<br></blockquote><div><br></div><div>I could get behind this one as well.</div><div><br></div></div></div>