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

Reserved keywords

What is a reserved keyword?

Reserved keywords are special identifiers, built into the compiler, which can’t be used by the user as a variable name, as they instead serve a special function (for example, starting a specific statement).

Reserved keywords in C²

Reserved keywords in C² are:

  • if
  • in
  • or
  • and
  • for
  • nil
  • new
  • try
  • int
  • bool
  • case
  • else
  • enum
  • func
  • self
  • true
  • break
  • catch
  • defer
  • false
  • float
  • spawn
  • throw
  • until
  • while
  • import
  • repeat
  • return
  • string
  • struct
  • switch
  • default
  • private
  • continue
  • function
  • optional

These can’t be used as:

  • Variable names.
  • Function names.
  • Structure names.
  • Field names.
  • Argument names.