1.12. Callbacks

Start felix section to tut/embedding/bind-1.11-0.flx[1 /1 ]
     1: #line 861 "./lpsrc/flx_tut_bind.pak"
     2: #import <flx.flxh>
     3: 
     4: callback fun f: int * f -> int;
     5: 
     6: fun g(x:int)=> x + x + 1;
     7: 
     8: print$ f(2, the g); endl;
     9: 
    10: callback proc p: int * p;
    11: 
    12: proc q(x:int){ print x; endl; }
    13: 
    14: p(31,the q);
    15: 
    16: typedef cf = int --> int;
    17: 
    18: proc h(y:cf, x:int) {
    19:   print$ y x; endl;
    20: }
    21: 
    22: body """
    23:   int yyy(int x) { return x + 3; }
    24: """;
    25: 
    26: const yyy: int --> int;
    27: 
    28: h(yyy,2);
End felix section to tut/embedding/bind-1.11-0.flx[1]
Start data section to tut/embedding/bind-1.11-0.expect[1 /1 ]
     1: 5
     2: 31
     3: 5
End data section to tut/embedding/bind-1.11-0.expect[1]