Re: buggy 4.0 program
- Posted by mattlewis (admin) Dec 11, 2008
- 1621 views
--g.e a=1-sin(a) puts(1,"test") --
It sees two unresolved references now.
But bug sits on different place.
So, it allows you to write buggy program and hopes
to see resolved references some future time.
Is it good? I do not think it is good.
No, once it can determine that there are bugs in your program, it lets you know. And, by the way, it gives you more information (though we obviously have a little work to do for reporting the correct character in the line).
Let's see yet another buggy program:
--h.e a=1-sin(a)+cos(a)*tan(a)/log(b)+power(a,b)-10 puts(1,"test") --
It sees a bunch of unresolved references, but just two
bugs sit on a different place.
Yes, in this case, the obvious bug is that you never declared or initialized a and b. The error generation is somewhat naive, in that it doesn't check for duplicates on the same line. It might be better to condense that a bit. But we definitely need to report all of those. Suppose they were typos, and we only reported one. Then you would change the first instance, re-run, and you'd get the same message. I think this would be very frustrating. Obviously, your example is very simple, but consider something like:
sequence foo enum SOMETHING, SOMETHING_ELSE ... ? foo[SOMETHIGN][SOMETHING_ELSE][3][SOMETHIGN..$]
If the error message didn't alert you to the fact that there were two errors for SOMETHIGN, it would be easy to spot the first, but less easy to spot the second. This would be especially true for multi-line expressions, where the reporting is usually on the first line of the expression.
So, there may be two different situations in a program:
presence of non-declared symbol(s) and conflict of declared symbols.
Non-declared symbols have to be just declared.
Error message - something like to "Can not find declaration of: [list]"
Or "Declare please: [list]", or just old good message of 1.0.
But conflict of declared symbols have to be resolved.
Error massage - "Unresolved conflict of: [list]" or something similar.
I'm not against changing the text of the errors. It seems clear to me, but it's my native language, and I'm probably too close to the internals, so I can see how it would come across as confusing jargon to someone not used to digging around in the guts of the interpreter.
There are some neutral forms well suitable for both plural and singular cases
in Russian and in English as well, I'm sure.
My trouble was and is about content mainly.
I don't think there are such constructs in English, unless you put the s in parentheses, or something like that.
Errors resolving the following reference(s):Matt