aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/closure_result.zc
blob: 57b666e9aac311d13270d6b75f52b33d79049ecd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
namespace;
include rt;

// fn:type(args) declares a closure's result; returns are coerced to it
fn put_f(x) { asm { x @ #1220 } return 0; }
fn main() {
	let half = fn:float(int x) { return x; };
	let twice = fn:int(int x) { return x * 2; };
	rt.put_n(twice(4)); rt.put_c(32);
	put_f(half(3) / 2.0); rt.put_c(10);
	return 0;
}