Currently, Swift limits operator names to punctuation-like and mathematical symbols. In particular, you can't use regular identifiers as operator names. While I can understand that there are probably some ambiguity issues with allowing normal identifiers as operator names, that doesn't change the fact that once you leave the realm of well-known operator symbols (e.g. +, -, *, /, etc.) they quickly become complete gibberish. For example, what does /=/ mean in a program, anyway?
While I'm not going to beg for normal identifier support (I suspect that if it were easy or possible, it would have been done already), I'm wondering if a special case could be made for identifiers surrounded by grave accents (back-tics)?
For example, I use the aforementioned /=/ operator as a "reverse ~=" operation. This lets me write:
if x /=/ 1...4 { do something }
(read as "if x is in the range 1...4 then...."
I find this easier to digest than
if 1...4 ~= x { do something }
Perhaps easier to digest, but still clear as mud. It would be really cool to create an operator name that actually has some meaning, such as
if x `in` 1...4 {do something}
Would it be possible to make a special case out of back-tic'd names and allow them as Swift operators?