Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static var _modulesArray : Array<String> = null;
- public static var modulesArray(get, null) : Array<String>;
- public static function get_modulesArray() : Array<String>
- {
- if (_modulesArray == null)
- {
- _modulesArray = new Array<String>();
- importConfig();
- }
- return _modulesArray;
- }
- public static function fillArray()
- {
- _modulesArray.push("File 1");
- Sys.println("Should be printed once");
- }
- private static var cached : Expr = null;
- macro public static function importConfig()
- {
- if (_modulesArray == null)
- _modulesArray = new Array<String>();
- if (cached != null)
- return cached;
- fillArray();
- cached = Context.makeExpr("Awesome config", Context.currentPos());
- return cached;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement