12 lines
270 B
Text
12 lines
270 B
Text
class MAIN is
|
|
do_something(i:INT):INT is
|
|
return i * i;
|
|
end;
|
|
|
|
main is
|
|
a:ARRAY{INT} := |1, 2, 3, 4, 5|;
|
|
-- we use an anonymous closure to apply our do_something "callback"
|
|
a.map(bind(do_something(_)));
|
|
loop #OUT + a.elt! + "\n"; end;
|
|
end;
|
|
end;
|