> On Oct 22, 2016, at 5:53 PM, Jonathan S. Shapiro 
> <[email protected]> wrote:
> 
> I missed this earlier posting from Joe Groff, who wrote:
> 
> In the discussion about operators, I wonder whether it makes sense to 
> formally separate "identifier" and "operator" characters at all. ...
> 
> The consequence if we do not formally separate the operators (verbs) from the 
> identifiers (nouns) is that white space will be needed around all operators. 
> That's not necessarily a bad thing, but it would be a significant and 
> incompatible departure from today's Swift, both in terms of actual source 
> code breakage and in terms of the "look and feel" that many people feel 
> passionate about.

That's not a strict requirement. If we require operator usage to be declared 
explicitly, the lexer can accommodate those declarations. Since operators only 
appear as part of expressions inside bodies, the operator import or declaration 
doesn't even necessarily have to be ordered at the top of the file since we can 
still skip function bodies when parsing declarations (though I think we'd want 
to encourage imports on top anyway for the benefit of readers). This wouldn't 
be unprecedented—operators as they stand already effectively require an extra 
pass of parsing.

-Joe

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to