3 # Demonstrate global elements in classes, procedures, and compound
10 alias stdio.File *stdout = stdio.stdout;
19 typedef int myint_t = 99;
21 # note that ( 7 ) is not compound, but Rune will always cast a non-compound
22 # expression to compound in the resolver if the resolver needs a compound
25 (global int x = 2, int y = 6) A = ( 7 );
28 const int xsize = 8192;
29 const int xmask = (xsize - 1);
33 main(int ac, char **av)
40 Test t4 = ( 8, 9, 10 );
44 stdout->show("sizeof(A) should be 4:", sizeof(A));
45 stdout->show("A.x should be 2:", A.x);
46 stdout->show("A.y should be 7:", A.y);
47 stdout->show("t1.a should be 3:", t1.a);
48 stdout->show("t1.c should be 4:", t1.c);
49 stdout->show("t2.a should be 2:", t2.a);
50 stdout->show("t3.z should be 99:", t3.z);
51 stdout->show("t4.z should be 10:", t4.z);
52 stdout->show("xsize should be 8192:", xsize);
53 stdout->show("xmask should be 8191:", xmask);
54 stdout->show("t4.z should be 10:", t4.z);