Re: trace(1) bug
- Posted by Pete Lomax <petelomax at blu?yonder.co?uk> Nov 14, 2007
- 568 views
CChris wrote: > I have always been a little surprised at repeated "i = xxx" > lines in ex.err; I expect some are downright confused. The extra lines > would just go away. > Which solution is preferrable? IMNSHO: allow only *ONE* i per context. allow eg:
procedure x() integer i -- see point C: for i=1 to 10 do if i=5 then exit end if end for ?i for i=1 to 20 do end for ?i end procedure }}} <eucode> A: to work (currently you get "attempt to redefine i"), B: to display either 5,20 or 5,21 (my preference is for latter), C: ditto whether i predefined or not, D: any ex.err lists one and only one i, per scope. E: any trace(1) screen "" "" "", except for: F: (erm?) trace screen allows inspection of callee i and other vars. G: whatever you do, you must still prohibit nested "for i=" loops. H: (doh) same deal for A:..G: with top-level code. I: top-level: for i=1 to 2 do end for integer i now craps out => "tough"! Obviously F: is a frill perhaps beyond the scope (no pun intended) of the immediate discussion. One caveat I can see is this: }}} <eucode> if x then for i=1 to 10 do end for ?i -- OK else ?i -- //iff i not predeclared, may warrant a warning? end if
Though personally, I'm OK with run-time "has not been assigned a value" and no compile-time warning, there may be many others, YMMV, etc. Regards, Pete