aboutsummaryrefslogtreecommitdiff
path: root/test/data/constants.yx
blob: cc9e6dfd3ef27030e57c71dd87c985e220f19eb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Basic definitions, with Unicode support */
π :: 3.14159265358979323846264338327950288419716939937510582097494459;
MEANING_OF_LIFE :: 42;

/* You can use them in expressions, and they can be defined
   out-of-order */
foo :: () int {
	x := MEANING_OF_LIFE;
	return x + MOL_DBL;
	MOL_DBL :: MEANING_OF_LIFE * 2;
}

/* You can perform constant shadowing */
bar :: () int {
	MEANING_OF_LIFE :: MEANING_OF_LIFE + 1;
	return MEANING_OF_LIFE;
}