Using Haxe: Part 3: Anonymous Structures

Learning Haxe

Using Haxe

Haxe is a strongly-typed multi-paradigm programming language that also supports cross-platform compiling into many different source and byte-code languages such as ActionScript 3, JavaScript, Java, C++, C#, PHP, Python, Lua, and Node.js.

Anonymous Structures

Haxe supports anonymous structures. Sometimes called object literals in other programming languages, an anonymous structure allows for defining an object-like data formation.

Anonymous structures are defined using curly brackets. Each entry within the structure is defined through a name, a colon, and then a value. This creates key-value pairs that can be accessed through its name like a property of an object.


Data within anonymous structures can be nested. This means that structures can have multiple levels where structures can be found within others.