[swift-evolution] Allow ' in variable/constant names?

Ben Rimmington me at benrimmington.com
Wed Jan 11 08:55:24 CST 2017


> On 11 Jan 2017, at 13:16, Charlie Monroe wrote:
> 
> Instead, I'd personally love better character support in Swift in the future and allow a Character literals using ' - just like in C, except with Unicode support:
> 
> let myChar = 'x' // Character
> let myChar2 = '∃' // Character
> let myChar3 = '\0' // NUL Character
> let myChar4 = 'xyz' // Error from compiler

This feature was removed (just before the first Swift 1.0 beta). Search for "Single-quoted literals are no longer recognized" in the CHANGELOG.

<https://github.com/apple/swift/blob/master/CHANGELOG.md#2014-05-13>

I'm looking forward to the "String re-evaluation" part of Swift 4 stage 1. Hopefully, the Character type will also be improved.

-- Ben



More information about the swift-evolution mailing list