summaryrefslogtreecommitdiff
path: root/point.toc
blob: 80506e13197b28f81ee523e60ec5935fdc092f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pkg "point";


#export Point ::= struct {
	x, y: int;
};
bar ::= fn() []int {
	x:[]int = new(int,20);
	each p, i := &x {
		 *p = i; 
	}
	x
};


#export x ::= bar();


#export mk_point ::= fn(x, y:=0) p : Point {
		 p.x = x;
		 p.y = y;
};


mk_point2 ::= fn(x, y:int) p: Point {
		  p = mk_point(x*x, y*y);
};

#export foo ::= fn(x :: int) int {
		// k : Point =		95;
		// p:=x[3];
};
#export a:=5;