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

SCM Repository

[diderot] Annotation of /branches/vis12/bugs/resolved/bug002.diderot
ViewVC logotype

Annotation of /branches/vis12/bugs/resolved/bug002.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2146 - (view) (download)
Original Path: branches/vis12/bugs/bug002.diderot

1 : glk 2146 /****************
2 :     (there are two programs here; uncomment one)
3 :    
4 :     Compiling this program gives:
5 :     [sqr-bug02.diderot:22.32-38] Error: undeclared variable 'foobar'
6 :     uncaught exception Fail [Fail: Error in compiling sqr-bug02.diderot]
7 :     raised at common/phase-timer.sml:76.50-76.52
8 :     raised at common/phase-timer.sml:76.50-76.52
9 :     raised at driver/main.sml:27.39-27.76
10 :    
11 :     So there is both the "Error" and the "Fail".
12 :     When there is a descriptive Error message, why have
13 :     all the uncaught exception stuff?
14 :    
15 :     ****************/
16 :    
17 :     real eps = 1.0;
18 :     strand sqroot(real val) {
19 :     output real root = val;
20 :     update {
21 :     root = (root + val/root)/2;
22 :     if (|root^2 - val|/val < foobar)
23 :     stabilize;
24 :     }
25 :     }
26 :     // Strand initialization
27 :     initially { sqroot(i) | i in 1..1000 };
28 :    
29 :    
30 :     /****************
31 :    
32 :     But compiling this program gives:
33 :     ...
34 :     mid-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 4 nodes, 3 visits, 1 iterations
35 :     low-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 3 nodes, 2 visits, 1 iterations
36 :     low-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 3 nodes, 2 visits, 1 iterations
37 :     low-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 18 nodes, 17 visits, 1 iterations
38 :     low-il DFA: cpu = 0.000 seconds, gc = 0.000 seconds, 4 nodes, 3 visits, 1 iterations
39 :     uncaught exception Fail [Fail: no output specified for strand sqroot]
40 :     raised at common/phase-timer.sml:76.50-76.52
41 :     raised at common/phase-timer.sml:76.50-76.52
42 :     raised at c-target/c-target.sml:151.37-151.83
43 :    
44 :     So there is actually a descriptive error message in the "Fail", but
45 :     there's no "Error". Why not put descriptive error messages in "Error",
46 :     and let the "uncaught exception" signify bugs in the compiler?
47 :     ****************/
48 :     /*
49 :     real eps = 1.0;
50 :     strand sqroot(real val) {
51 :     real root = val;
52 :     update {
53 :     root = (root + val/root)/2;
54 :     if (|root^2 - val|/val < eps)
55 :     stabilize;
56 :     }
57 :     }
58 :     // Strand initialization
59 :     initially { sqroot(i) | i in 1..1000 };
60 :     */

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