2.1.2. Macro variables

The macro var statement defines a LHS symbol as the expansion of the RHS. The same value can be defined any number of times, a redefinition hides the preceding defintion until the end of the scope.

Macro variables can be assigned a new value.

Start C++ section to tut/examples/mac123.flx[1 /1 ]
     1: include "std";
     2: macro var mx1 = 1+y;
     3: val y = 100;
     4: print mx1; endl; // 101
     5: {
     6:   macro mx1 = 3+y; // 103 [assignment!]
     7:   print mx1; endl;
     8: };
     9: print mx1; endl; // 103 [uses assigned value]
    10: 
    11: 
End C++ section to tut/examples/mac123.flx[1]