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 felix section to tut/examples/mac123.flx[1 /1 ]
     1: #line 220 "./lpsrc/flx_tut_macro.pak"
     2: #import <flx.flxh>
     3: macro var mx1 = 1+y;
     4: val y = 100;
     5: print mx1; endl; // 101
     6: {
     7:   macro mx1 = 3+y; // 103 [assignment!]
     8:   print mx1; endl;
     9: };
    10: print mx1; endl; // 103 [uses assigned value]
    11: 
End felix section to tut/examples/mac123.flx[1]