Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Why doesn't this work in Swift?
Here's the code: var ā = 56 print(ā) Why doesn't this work even though Swift supports unicode characters? According to me, I haven't violated any variable-naming rules.
2 Respostas
+ 11
https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-ID412
Under "Identifiers":
"...Identifiers begin with an uppercase or lowercase letter A through Z, an underscore (_), a noncombining alphanumeric Unicode character in the Basic Multilingual Plane, or a character outside the Basic Multilingual Plane that isnāt in a Private Use Area. After the first character, digits and combining Unicode characters are also allowed... "
The hollow star you used, if I'm not mistaken, is U+2606. This appears to lie outside the accepted range of unicode starting U+20xx to U+27xx.
identifier-head ā U+2070āU+20CF, U+2100āU+218F, U+2460āU+24FF, or U+2776āU+2793
+ 1
Hatsy Rei Thank you very much.