Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/test/uninit.diderot
ViewVC logotype

Annotation of /branches/pure-cfg/test/uninit.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 926 - (view) (download)

1 : glk 926
2 :    
3 :     int imgSizeX = 300;
4 :     int imgSizeY = 200;
5 :    
6 :     image(2)[2] Vimg = load("../data/vorttest.nrrd");
7 :     field#1(2)[2] V = Vimg ⊛ ctmr;
8 :     image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
9 :     field#0(2)[] R = Rimg ⊛ tent;
10 :    
11 :     strand LIC (int xi, int yi) {
12 :     real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
13 :     real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
14 :     vec2 pos = [xx,yy];
15 :     // HEY (want) the errors due to not initializing variables are
16 :     // pretty cryptic. The line "output vec2 blah" here causes:
17 :     // [uninit.diderot:28.18] Error: syntax error; try substituting "{" for ";"
18 :     // [uninit.diderot:24.21] Error: syntax error; try deleting "; update { ID"
19 :     // uncaught exception Fail [Fail: Error in compiling uninit.diderot]
20 :     // raised at driver/main.sml:31.39-31.76
21 :     // which is cryptic in part because line ?? is the "stabilize;" line,
22 :     // while line ?? is in fact the following problem line, but
23 :     // there's nothing about a lack of initialization.
24 :     output vec2 blah; // should be, e.g. output vec2 blah = [0.0,0.0];
25 :    
26 :     update {
27 :     blah = V(pos);
28 :     stabilize;
29 :     }
30 :     }
31 :    
32 :     initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0