1: #line 2397 "./lpsrc/flx_tutorial.pak"
2:
3: val f = fun(a:int):int = { return a * a; };
4:
5: print (f 1);
6: endl;
7:
8: print
9: (
10: (fun(a:int):int = { return a * a; })
11: 1
12: );
13: endl;
14:
15: proc thrice(p:unit->void) { p(); p(); p(); }
16: thrice ( proc() { print 3; endl; } );
17: thrice ( proc { print 3; endl; } );
18: thrice { print 3; endl; };
19: { print "finished"; endl; };
20:
Mickey Mouse! Checkout the shortcut on the
second last line. You can just write
statements in curly brackets for an
anonymous procedure taking unit argument,
you can leave off the