[swift-evolution] Allowing Characters for use as Custom Operators

Jo Albright me at jo2.co
Thu Jan 7 19:26:16 CST 2016


Chris - I really appreciate that you take the time to entertain & respond to proposals. 

> On Jan 7, 2016, at 7:24 PM, Chris Lattner <clattner at apple.com> wrote:
> 
> 
>> On Jan 7, 2016, at 1:31 AM, Jo Albright via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> As my obsession grows with custom operators. I have come across wanting to use small words or 1-2 alphabetical characters as custom operators. I noticed that “as” and “is” are character based operators and figured it wouldn’t hurt to propose the allowance of character based custom operators.
>> 
>> Here are my reasons for allowing them:
>> 
>> 1. easier to read “within” vs “>*<“ or “|*|” 
> 
> Check out Replace Logical Operators (&&, ||, etc) with words like "and" and “or":
> https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md <https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md>
I completely agree with that proposal being rejected. I am not asking to replace existing language grammar. My desire is for the support of alphabetical characters for custom operators to allow third party libraries to have their own unique grammar.
 
> There is very small win here of “x foo y” over "x.foo(y)”?

And I completely agree that function/method syntax can easily suffice for normal circumstances. Just trying to see how far Swift can be stretched.

 Nerd . Designer . Developer
Jo Albright

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160107/215b7c5a/attachment.html>


More information about the swift-evolution mailing list