Edit

kc3-lang/kc3/doc/1_KC3/1.22_Sym.en.md

Branch :

  • doc/1_KC3/1.22_Sym.en.md
  • # 1.22 Sym
    
    The KC3 type `Sym` is used everywhere in KC3. This is symbolic
    computing : the triple store and data rely on interned strings
    which are easy to compare for equality.
    
    Sorting still relies on Sym's string representation so is slower
    than just comparing pointers.
    
    Symbols either start with a capital letter character, in which
    case this symbol also is a package name (see Packages).
    Otherwise symbols start with `:` and if the symbol string contains
    reserved characters then the symbol is quoted.
    
    ## 1.22.1 Examples
    
    ```elixir
    ikc3> :"123"
    :123
    ikc3> type(:123)
    Sym
    ikc3> MyModule
    MyModule
    ikc3> type(MyModule)
    Sym
    ```
    
    ---
    
    Top : [KC3 documentation](../)
    
    Previous : [1.21 Struct](1.21_Struct)
    
    Next : [1.23 Tuple](1.23_Tuple)