[swift-evolution] [Proposal] Refining Identifier and Operator Symbology
erica at ericasadun.com
Thu Oct 20 10:08:19 CDT 2016
> On Oct 19, 2016, at 11:17 PM, Jonathan S. Shapiro via swift-evolution <swift-evolution at swift.org> wrote:
> On Wed, Oct 19, 2016 at 1:31 PM, David Waite via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> The problem is that this set does not just contain mathematical operators, but includes among other examples \u2205 (Empty Set) and \u221E (infinity).
> Both of which are perfectly reasonable symbols to include.
> From a UAX31 standpoint, the practical problem is that operator symbols are going to get defined largely in terms of the existing symbol category. It's not going to be perfect. Traditionally, Unicode standards have been defined in terms of properties rather than blocks. I do think its worth asking whether "mathematical symbols" is too broad and we may wish to consider only "mathematical operators". I'll take that up with Mark.
> This is one reason that I was briefly exploring whether operator identifiers could actually be used as identifiers generally. The answer boils down to: "not if operator symbols admit . (period)". Unfortunately, the existing Swift standard library is already using .
I really liked Jonathan's suggestion that removed the distinction between operators and identifiers entirely. You could mark a one-argument function as postfix or prefix, and a two-argument function as infix and use them as a kind of pseudo keyword.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution