[swift-evolution] [Proposal] Refining Identifier and Operator Symbology
Paul Cantrell
cantrell at pobox.com
Wed Oct 19 14:49:06 CDT 2016
> On Oct 19, 2016, at 12:21 PM, Rob Mayoff via swift-evolution <swift-evolution at swift.org> wrote:
>
> On Wed, Oct 19, 2016 at 10:47 AM, plx via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> In any case, I’d specifically hate to lose these:
>
> - approximate equality: ≈
> - set operations: ∩, ∪
> - set relations: ⊂, ⊃, ⊄, ⊅, ⊆, ⊇, ⊈, ⊉, ⊊, ⊋
> - set membership: ∌, ∋, ∈, ∉
> - logical operators: ¬, ∧, ∨
>
> I'd add ≤ ≥ ≠ to that set.
I have production code that uses ± and ≈.
As with all operator overloads, there is room for abuse — but I’ve been using these operators to mean what it looks like they should mean, and am very pleased with the readability benefits.
At the very least, Swift ought to support operators using symbols from the Unicode blocks called “Mathematical Operators” and “Supplemental Mathematical Operators.”
https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode <https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode>
It’s right there in the name!™
Cheers, P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161019/83d5bf78/attachment.html>
More information about the swift-evolution
mailing list