[swift-evolution] [Proposal] Refining Identifier and Operator Symbology
David Sweeris
davesweeris at mac.com
Thu Oct 27 08:20:52 CDT 2016
Sent from my iPhone
> On Oct 25, 2016, at 10:24, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
>
>> Ok, but to clarify the requirement, *every* file would have to declare the operators it is using at the top of the file. It isn’t enough for them to be declared in some file within the current module. Not having this property breaks the ability to do a quick parse of a file without doing name lookup.
>
> Yeah, that's a tradeoff. I think that requiring non-standard operator use to be explicitly declared could be a good thing, though, since I don't think that we can realistically expect users to learn or intuitively agree on what glyphs are "operator" or "identifier", no matter what character set we design.
I could get behind having to explicitly import operators:
import CoolLib
import operators CoolLib
or
import CoolLib {types functions vars operators}
But having to re-declare every "non-standard" operator for every file really limits their usefulness, IMHO.
> As long as { } aren't in the operator character set, we should still be able to skip function bodies without parsing, so operator use declarations could still be order-independent at the top level of declarations. (Whether it's a good idea to bury your import declarations in the middle of your other decls is another story.)
Oh, is using {} as operators on the table? There's gotta be some interesting syntax someone could make with those...
- Dave Sweeris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161027/fe064188/attachment.html>
More information about the swift-evolution
mailing list