Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Created August 31, 2021 21:44
Show Gist options
  • Save KinoAR/b0bdff58893555e85d9e1da1cbd8a888 to your computer and use it in GitHub Desktop.
Save KinoAR/b0bdff58893555e85d9e1da1cbd8a888 to your computer and use it in GitHub Desktop.
An example of Struct Init usage within the Haxe programming language.
@:structInit class Person {
final name:String;
var age:Int = 30;
public function new(name:String, age:Int) {
this.name = name;
this.age = age;
}
public function greet()
trace( 'Hello, I\'m $name, and I\'m $age years old!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment