From this document:
To use a reserved word as an identifier, put a backtick (`) before and after it.
I'm curious about the practical application of this. When would you actually want to name something `class`
, `self`
, etc.?
Or, relatedly, why did the designers of Swift allow this, rather than just forbidding us from using reserved words as identifiers?
struct Filename { var ˋextensionˋ = "txt" }
. A standard way of dealing with this is better than having to define my own non-failproof scheme, for instance using “_extension”. – Overgrowth