Expressions in Haxe define what a program does. Most expressions are found in the body of a method, where they are combined to express what that method should do. This section explains the different kinds of expressions. Some definitions help here:
Define: Name
A general name may refer to
- a type,
- a local variable,
- a local function or
- a field.
Define: Identifier
Haxe identifiers start with an underscore
_, a dollar$, a lower-case charactera-zor an upper-case characterA-Z. After that, any combination and number of_,A-Z,a-zand0-9may follow.Further limitations follow from the usage context, which are checked upon typing:
- Type names must start with an upper-case letter
A-Zor an underscore_.- Leading dollars are not allowed for any kind of name (dollar-names are mostly used for macro reification).
Haxe reserves the identifier prefix _hx_ for internal use. This is not enforced by the parser or typer.
The following Haxe keywords may not be used as identifiers:
abstractbreakcasecastcatchclasscontinuedefaultdodynamicelseenumextendsexternfalsefinalforfunctionifimplementsimportininlineinterfacemacronewnulloperatoroverloadoverridepackageprivatepublicreturnstaticswitchthisthrowtruetrytypedefuntypedusingvarwhile