11.1.1 상수 인자(Constant Arguments)

11.1.1 상수 인자(Constant Arguments)

상수 인자는 null, true, false 또는 숫자/문자열 리터럴, 그러한 값들로 구성된 배열 등을 나타낼 수 있는 매크로 인자입니다.

macro function returnFive() return 5;
macro function readArgument(x:Int) return x;

class Main {
  static function main() {
    $type(returnFive()); // Int
    trace(returnFive()); // 5
    trace(readArgument(4)); // 4  - Not to be confused with parameter x:Int=4 at compile time
  }
}

출처: Constant Arguments

더 알아보기