11.8 매크로 초기화(Macro Initialization)
11.8 매크로 초기화(Macro Initialization)
매크로는 컴파일 타임에 초기화됩니다. 초기화는 @:init 메타데이터에 의해 수행되며, 각 매크로는 초기화 순서를 제어할 수 있습니다.
@:init는 매크로 정의가 있는 모듈이 초기화될 때 실행됩니다. 순서를 지정하려면 @:init(order) 형식을 사용할 수 있습니다.
@:init(2)
class SecondInit {
static function init() {
trace("Second");
}
}
@:init(1)
class FirstInit {
static function init() {
trace("First");
}
}