1: include "std";
2: val f = fun(a:int):int = { return a * a; };
3:
4: print (f 1);
5: endl;
6:
7: print
8: (
9: (fun(a:int):int = { return a * a; })
10: 1
11: );
12: endl;
13:
14: proc thrice(p:unit->void) { p(); p(); p(); }
15: thrice ( proc() { print 3; endl; } );
16: thrice ( proc { print 3; endl; } );
17: thrice { print 3; endl; };
18: { print "finished"; endl; };
19:
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