[swift-evolution] [Returned for revision] SE-0077: Improved operator declarations

T.J. Usiyan griotspeak at gmail.com
Thu Jun 23 11:13:44 CDT 2016


If we chose something other than strongerThan and weakerThan, I would
really like to see something like

 evaluateBefore, evaluateAfter
foundBefore, foundAfter
lookupBefore, lookupAfter


On Thu, Jun 23, 2016 at 11:32 AM, Anton Zhilin via swift-evolution <
swift-evolution at swift.org> wrote:

> Ross O'Brien via swift-evolution <swift-evolution at ...> writes:
>
> > The naming suggestion: why not simply 'precedes' and 'succeeds'? This
> avoids the conjoined words problem. Then you're just writing
> 'Multiplication { succeeds: Exponentiation, precedes: Addition }'.
>
> I still believe that `above` and `below` are clearer.
>
> > Suppose wanted to define C's precedence so its operation preceded both A
> and B, or succeeded both A and B. Does that require an explicit
> declaration of which of A or B takes precedence? If not, would this be
> legal?:
> > 'precedencegroup C { strongerThan: A, strongerThan: B }'
>
> Any number of strongerThan and weakerThan relationships should be legal.
> Order of these relationships does not matter. We model them as edges of a
> DAG of all declared operators.
>
> There will be no problems during parsing. For example,
> https://en.wikipedia.org/wiki/Shunting-yard_algorithm
> only requests equality and less-than relationships between two operators.
>
> - Anton
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160623/c8e438ed/attachment.html>


More information about the swift-evolution mailing list