Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Types

Andy C++ is currently a dynamically typed language, that means that type checks are performed at runtime. Although you currently can’t annotate your variables using type names they do have types at runtime.

The type system is hierarchical with the root type being Any:

  • Any
    • Option
    • Boolean
    • Number
      • Integer
        • Int64 (64bit signed)
        • Bigint (unlimited size)
      • Float
      • Complex
      • Rational
    • Sequence
      • String: A mutable list of characters
      • List: A mutable list
      • Tuple: An immutable list
      • Map: A hashmap that associates keys with values
      • Deque: A double ended queue
      • MinHeap & MaxHeap: Min/max Heap
      • Iterator: A type that can be consumed and produces values (Currently only used for range expressions like 5..100)
    • Function

Note: Any is the base type for all other types. When you declare a function, its arguments default to type Any. Currently, the Any type is implicit and does not appear explicitly in the language.