4. Scope

Unlike C++, the scope of an identifier is the whole of the construction containing it, just like labels. In particular, all functions in the same scope are mutually recursive: a function can be called before it is defined without a forward declaration.
Start felix section to tut/examples/mig03.flx[1 /1 ]
     1: #line 191 "./lpsrc/flx_tut_migrate.pak"
     2: #import <flx.flxh>
     3: fun f(x:int) => g(x-1);
     4: fun g(x:int) => if x>0 then f(x-1) else 0 endif;
     5: print (g 10); endl;
     6: 
End felix section to tut/examples/mig03.flx[1]
In particular this rule also applies to types, allowing recursive types to be easily defined:
Start felix section to tut/examples/mig04.flx[1 /1 ]
     1: #line 201 "./lpsrc/flx_tut_migrate.pak"
     2: #import <flx.flxh>
     3: union ilist = empty | cons of int * ilist;
     4: var x = empty;
     5: x = cons (1,x);
     6: x = cons (2,x);
     7: 
     8: proc xprint(x:ilist) {
     9:   match x with
    10:   | empty => {}
    11:   | cons (?h,?t) => { print h; print " "; xprint t; }
    12:   endmatch;
    13: }
    14: 
    15: xprint x; endl;
    16: 
End felix section to tut/examples/mig04.flx[1]