> On 3 Apr 2016, at 11:45, Антон Жилин <[email protected]> wrote:
> 
> > Assuming these are defined in separate modules, how do we determine the 
> > order of • and ~?
> 
> By default, priority between any two operators is undefined. If two modules 
> don't know about each other, but the user wishes to prioritize them, then he 
> will write:
> 
> #precedence(•, lessThan: ~)
> 
> If • suddenly wishes to cooperate with ~, then it will add directives:
> 
> #operator(~, fixity: infix, associativity: left)
> #precedence(•, lessThan: ~)
> 
> It doesn't matter if ~ or user have already added them: if they do not 
> contain contradictory information, there will be no conflict.

Ah, I misunderstood then, so a warning/error will be raised if no precedence 
exists? Thanks for the explanation! I’ll probably still favour overkill 
brackets, but this makes sense.

In any event I’m on +1 for the more standardised syntax and the switch to using 
#directives, makes a lot of sense since these are really just customisable 
compiler symbols.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to